@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
@@ -40,6 +40,10 @@ type DevRecord = {
40
40
  createdAt: Date;
41
41
  updatedAt: Date;
42
42
  values: DevValue[];
43
+ /** 서버 미러 — 값 갱신마다 +1 (production API의 `version`). */
44
+ version: number;
45
+ /** 서버 미러 — 지나면 조회·유일성 검사에서 제외(production API의 `expiresAt`). */
46
+ expiresAt: Date | null;
43
47
  };
44
48
  type DevAuthUser = {
45
49
  id: string;
@@ -247,6 +251,8 @@ declare class InMemoryStore {
247
251
  getEntitiesByBrandapp(brandappId: string): DevEntity[];
248
252
  getAttributesByEntity(entityId: string): DevAttribute[];
249
253
  getRecordsByEntity(entityId: string): DevRecord[];
254
+ /** 만료된 행 물리 삭제 — production 크론 `/api/cron/eav-record-expire` 미러. */
255
+ purgeExpiredRecords(): number;
250
256
  getRecordValues(recordId: string): DevValue[];
251
257
  /**
252
258
  * Produce a snapshot that is safe to mutate without affecting the store.
@@ -467,4 +473,4 @@ type DevServer = {
467
473
  declare function createDevServer(options?: DevServerOptions): Promise<DevServer>;
468
474
  //#endregion
469
475
  export { DevPost as _, SeedAllInput as a, InMemoryStore as b, SeedPostGroupInput as c, SeedTermsItem as d, createDevServer as f, DevEntity as g, DevAttribute as h, ProxyConfig as i, SeedPostInput as l, markdownToEditorSpecMany as m, DevServer as n, SeedData as o, markdownToEditorSpec as p, DevServerOptions as r, SeedOptions as s, DevSchema as t, SeedRecordInput as u, DevPostGroup as v, StoreSnapshot as x, DevRecord as y };
470
- //# sourceMappingURL=index-DV_OWwx5.d.ts.map
476
+ //# sourceMappingURL=index-C6fyJTud.d.ts.map
@@ -1,14 +1,14 @@
1
- import { l as SchemaDef, n as ReoptSDKConfig } from "./config-C7WQtC3l.js";
2
- import { t as ReoptAiClient } from "./client-DPbXH8tr.js";
3
- import { t as ReoptAnalyticsClient } from "./client-DZu4msTG.js";
4
- import { t as ReoptAuthClient } from "./client-yBQen4Yi.js";
5
- import { t as ReoptCmsClient } from "./client-BTS6Ewv_.js";
6
- import { t as ReoptEavClient } from "./client-CAGo56KO.js";
7
- import { t as ReoptFeedbackClient } from "./client-Ckm-i_Du.js";
8
- import { t as ReoptFileClient } from "./client-A4YrHjDc.js";
9
- import { t as ReoptPlansClient } from "./client-BGLDrf3N.js";
10
- import { t as ReoptPushClient } from "./client-DfEeaOsQ.js";
11
- import { t as ReoptTermsClient } from "./client-DHZ484kb.js";
1
+ import { l as SchemaDef, n as ReoptSDKConfig } from "./config-D28P8iwm.js";
2
+ import { t as ReoptAiClient } from "./client-DA9ibl3G.js";
3
+ import { t as ReoptAnalyticsClient } from "./client-D5F6-YYU.js";
4
+ import { t as ReoptAuthClient } from "./client-CNPfjmT0.js";
5
+ import { t as ReoptCmsClient } from "./client-DYammrtw.js";
6
+ import { t as ReoptEavClient } from "./client-DjgoTlfv.js";
7
+ import { t as ReoptFeedbackClient } from "./client-B4CiEei5.js";
8
+ import { t as ReoptFileClient } from "./client-BOEyVc8V.js";
9
+ import { t as ReoptPlansClient } from "./client-CRim5LCH.js";
10
+ import { t as ReoptPushClient } from "./client-bXAnGNzC.js";
11
+ import { t as ReoptTermsClient } from "./client-BBxhqs8l.js";
12
12
  //#region src/core/http-client.d.ts
13
13
  type FetchOptions = {
14
14
  /** Abort the request via an external AbortSignal (merged with timeout signal). */
@@ -168,4 +168,4 @@ type ReoptSDK<S extends SchemaDef = SchemaDef> = {
168
168
  declare function createReoptSDK<S extends SchemaDef = SchemaDef>(config: ReoptSDKConfig<S>): ReoptSDK<S>;
169
169
  //#endregion
170
170
  export { initReoptSDK as a, getReoptSDK as i, createReoptSDK as n, resetSDK as o, createLazySDK as r, BaseHttpClient as s, ReoptSDK as t };
171
- //# sourceMappingURL=index-DJMr3ixA.d.ts.map
171
+ //# sourceMappingURL=index-DwIr8W3Y.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { a as DebugLogger, i as DebugLevel, n as ReoptSDKConfig, r as resolveBaseUrl, t as REOPT_BASE_URLS } from "./config-C7WQtC3l.js";
2
- import { a as CompletionOptions, c as FinishReason, d as MessageRole, f as ModelInfo, i as ChatMessage, l as ImageGenerateOptions, m as StreamEvent, o as CompletionResult, p as StreamDoneData, r as AgentInfo, s as CreditInfo, u as ImageGenerateResult } from "./client-DPbXH8tr.js";
3
- import { C as isModelAccessError, D as mapHttpStatusToError, E as isValidationError, S as isCreditLimitError, T as isRequiredTermsError, _ as ReoptSDKError, a as ConflictError, b as ServerError, c as DuplicateAuthUserError, d as ForbiddenError, f as LimitExceededError, g as RateLimitError, h as NotFoundError, i as BadRequestError, l as ErrorDiagnostic, m as ModelNotFoundError, n as AuthUserNotFoundError, o as ContentFilterError, p as ModelAccessError, r as AuthUserRecordExistsError, s as CreditLimitError, t as AuthError, u as FieldError, v as ReoptSDKErrorContext, w as isReoptSDKError, x as ValidationError, y as RequiredTermsError } from "./errors-CRCcErNC.js";
4
- import { i as TypedEavRecord, r as EntityClient } from "./client-CAGo56KO.js";
5
- import { a as initReoptSDK, i as getReoptSDK, n as createReoptSDK, o as resetSDK, r as createLazySDK, s as BaseHttpClient, t as ReoptSDK } from "./index-DJMr3ixA.js";
6
- export { type AgentInfo, AuthError, AuthUserNotFoundError, AuthUserRecordExistsError, BadRequestError, BaseHttpClient, type ChatMessage, type CompletionOptions, type CompletionResult, ConflictError, ContentFilterError, type CreditInfo, CreditLimitError, type DebugLevel, type DebugLogger, DuplicateAuthUserError, type EntityClient, type ErrorDiagnostic, type FieldError, type FinishReason, ForbiddenError, type ImageGenerateOptions, type ImageGenerateResult, LimitExceededError, type MessageRole, ModelAccessError, type ModelInfo, ModelNotFoundError, NotFoundError, REOPT_BASE_URLS, RateLimitError, ReoptSDK, type ReoptSDKConfig, ReoptSDKError, type ReoptSDKErrorContext, RequiredTermsError, ServerError, type StreamDoneData, type StreamEvent, type TypedEavRecord, ValidationError, createLazySDK, createReoptSDK, getReoptSDK, initReoptSDK, isCreditLimitError, isModelAccessError, isReoptSDKError, isRequiredTermsError, isValidationError, mapHttpStatusToError, resetSDK, resolveBaseUrl };
1
+ import { a as DebugLogger, i as DebugLevel, n as ReoptSDKConfig, r as resolveBaseUrl, t as REOPT_BASE_URLS } from "./config-D28P8iwm.js";
2
+ import { a as CompletionOptions, c as FinishReason, d as MessageRole, f as ModelInfo, i as ChatMessage, l as ImageGenerateOptions, m as StreamEvent, o as CompletionResult, p as StreamDoneData, r as AgentInfo, s as CreditInfo, u as ImageGenerateResult } from "./client-DA9ibl3G.js";
3
+ import { C as isCreditLimitError, D as isValidationError, E as isRequiredTermsError, O as mapHttpStatusToError, S as ValidationError, T as isReoptSDKError, _ as RateLimitError, a as ConflictError, b as RequiredTermsError, c as DuplicateAuthUserError, d as ForbiddenError, f as LimitExceededError, g as PreconditionFailedError, h as NotFoundError, i as BadRequestError, l as ErrorDiagnostic, m as ModelNotFoundError, n as AuthUserNotFoundError, o as ContentFilterError, p as ModelAccessError, r as AuthUserRecordExistsError, s as CreditLimitError, t as AuthError, u as FieldError, v as ReoptSDKError, w as isModelAccessError, x as ServerError, y as ReoptSDKErrorContext } from "./errors-U3TsyWVq.js";
4
+ import { i as TypedEavRecord, r as EntityClient } from "./client-DjgoTlfv.js";
5
+ import { a as initReoptSDK, i as getReoptSDK, n as createReoptSDK, o as resetSDK, r as createLazySDK, s as BaseHttpClient, t as ReoptSDK } from "./index-DwIr8W3Y.js";
6
+ export { type AgentInfo, AuthError, AuthUserNotFoundError, AuthUserRecordExistsError, BadRequestError, BaseHttpClient, type ChatMessage, type CompletionOptions, type CompletionResult, ConflictError, ContentFilterError, type CreditInfo, CreditLimitError, type DebugLevel, type DebugLogger, DuplicateAuthUserError, type EntityClient, type ErrorDiagnostic, type FieldError, type FinishReason, ForbiddenError, type ImageGenerateOptions, type ImageGenerateResult, LimitExceededError, type MessageRole, ModelAccessError, type ModelInfo, ModelNotFoundError, NotFoundError, PreconditionFailedError, REOPT_BASE_URLS, RateLimitError, ReoptSDK, type ReoptSDKConfig, ReoptSDKError, type ReoptSDKErrorContext, RequiredTermsError, ServerError, type StreamDoneData, type StreamEvent, type TypedEavRecord, ValidationError, createLazySDK, createReoptSDK, getReoptSDK, initReoptSDK, isCreditLimitError, isModelAccessError, isReoptSDKError, isRequiredTermsError, isValidationError, mapHttpStatusToError, resetSDK, resolveBaseUrl };
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import { A as mapHttpStatusToError, C as ServerError, D as isReoptSDKError, E as isModelAccessError, O as isRequiredTermsError, S as RequiredTermsError, T as isCreditLimitError, _ as ModelAccessError, b as RateLimitError, c as AuthUserNotFoundError, d as ConflictError, f as ContentFilterError, g as LimitExceededError, h as ForbiddenError, i as resolveBaseUrl, k as isValidationError, l as AuthUserRecordExistsError, m as DuplicateAuthUserError, p as CreditLimitError, r as assertBrowserSafe, s as AuthError, t as REOPT_BASE_URLS, u as BadRequestError, v as ModelNotFoundError, w as ValidationError, x as ReoptSDKError, y as NotFoundError } from "./config-tEsB7QhQ.js";
2
- import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
3
- import { n as createReoptAiClient } from "./client-Dx3sYx7V.js";
4
- import { n as createReoptAuthClient } from "./client-CP9RSAzn.js";
5
- import { t as createReoptCmsClient } from "./client-CTefnLKY.js";
6
- import { t as createReoptEavClient } from "./client-CHp-oNJB.js";
7
- import { n as createReoptFeedbackClient } from "./client-SwByFT8p.js";
8
- import { n as createReoptFileClient } from "./client-mvcEj1Vq.js";
9
- import { n as createReoptAnalyticsClient } from "./client-2IaU8yUs.js";
10
- import { n as createReoptPlansClient } from "./client-DE3FvPFs.js";
11
- import { n as createReoptPushClient } from "./client-D_7G37OB.js";
12
- import { n as createReoptTermsClient } from "./client-Dnp7_J0-.js";
1
+ import { A as isValidationError, C as RequiredTermsError, D as isModelAccessError, E as isCreditLimitError, O as isReoptSDKError, S as ReoptSDKError, T as ValidationError, _ as ModelAccessError, b as PreconditionFailedError, c as AuthUserNotFoundError, d as ConflictError, f as ContentFilterError, g as LimitExceededError, h as ForbiddenError, i as resolveBaseUrl, j as mapHttpStatusToError, k as isRequiredTermsError, l as AuthUserRecordExistsError, m as DuplicateAuthUserError, p as CreditLimitError, r as assertBrowserSafe, s as AuthError, t as REOPT_BASE_URLS, u as BadRequestError, v as ModelNotFoundError, w as ServerError, x as RateLimitError, y as NotFoundError } from "./config-D8dSL6OQ.js";
2
+ import { t as BaseHttpClient } from "./http-client-0Sp8wQGQ.js";
3
+ import { n as createReoptAiClient } from "./client-BMgVQ4U-.js";
4
+ import { n as createReoptAuthClient } from "./client-CIUecAJE.js";
5
+ import { t as createReoptCmsClient } from "./client-BD1-resY.js";
6
+ import { t as createReoptEavClient } from "./client-CaWHvclV.js";
7
+ import { n as createReoptFeedbackClient } from "./client-p4LmfF27.js";
8
+ import { n as createReoptFileClient } from "./client-vjIDamSf.js";
9
+ import { n as createReoptAnalyticsClient } from "./client-Hc7SfeIf.js";
10
+ import { n as createReoptPlansClient } from "./client-BVvAfEXG.js";
11
+ import { n as createReoptPushClient } from "./client-D4kUDFwW.js";
12
+ import { n as createReoptTermsClient } from "./client-BpEWDfSl.js";
13
13
 
14
14
  //#region src/singleton.ts
15
15
  let _instance;
@@ -131,5 +131,5 @@ function createReoptSDK(config) {
131
131
  }
132
132
 
133
133
  //#endregion
134
- export { AuthError, AuthUserNotFoundError, AuthUserRecordExistsError, BadRequestError, BaseHttpClient, ConflictError, ContentFilterError, CreditLimitError, DuplicateAuthUserError, ForbiddenError, LimitExceededError, ModelAccessError, ModelNotFoundError, NotFoundError, REOPT_BASE_URLS, RateLimitError, ReoptSDKError, RequiredTermsError, ServerError, ValidationError, createLazySDK, createReoptSDK, getReoptSDK, initReoptSDK, isCreditLimitError, isModelAccessError, isReoptSDKError, isRequiredTermsError, isValidationError, mapHttpStatusToError, resetSDK, resolveBaseUrl };
134
+ export { AuthError, AuthUserNotFoundError, AuthUserRecordExistsError, BadRequestError, BaseHttpClient, ConflictError, ContentFilterError, CreditLimitError, DuplicateAuthUserError, ForbiddenError, LimitExceededError, ModelAccessError, ModelNotFoundError, NotFoundError, PreconditionFailedError, REOPT_BASE_URLS, RateLimitError, ReoptSDKError, RequiredTermsError, ServerError, ValidationError, createLazySDK, createReoptSDK, getReoptSDK, initReoptSDK, isCreditLimitError, isModelAccessError, isReoptSDKError, isRequiredTermsError, isValidationError, mapHttpStatusToError, resetSDK, resolveBaseUrl };
135
135
  //# sourceMappingURL=index.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/logout/verify.d.ts
3
3
  type VerifyLogoutTokenOptions = {
4
4
  /** 자기 OAuth client_id — logout_token `aud` 검증. 미지정 시 config/env에서 유도. */
@@ -1,4 +1,4 @@
1
- import { a as resolveIdBaseUrl, x as ReoptSDKError } from "../config-tEsB7QhQ.js";
1
+ import { S as ReoptSDKError, a as resolveIdBaseUrl } from "../config-D8dSL6OQ.js";
2
2
 
3
3
  //#region src/logout/verify.ts
4
4
  /**
@@ -1,2 +1,2 @@
1
- import { a as CheckoutStatus, c as MeterPricingMode, d as PlanInterval, f as PlanMeter, i as CheckoutSession, l as Plan, m as PlanRequiredTerms, n as createReoptPlansClient, o as CreateCheckoutInput, p as PlanMeterTier, r as CancelSubscriptionResult, s as CurrentPlan, t as ReoptPlansClient, u as PlanBillingModel } from "../client-BGLDrf3N.js";
1
+ import { a as CheckoutStatus, c as MeterPricingMode, d as PlanInterval, f as PlanMeter, i as CheckoutSession, l as Plan, m as PlanRequiredTerms, n as createReoptPlansClient, o as CreateCheckoutInput, p as PlanMeterTier, r as CancelSubscriptionResult, s as CurrentPlan, t as ReoptPlansClient, u as PlanBillingModel } from "../client-CRim5LCH.js";
2
2
  export { type CancelSubscriptionResult, type CheckoutSession, type CheckoutStatus, type CreateCheckoutInput, type CurrentPlan, type MeterPricingMode, type Plan, type PlanBillingModel, type PlanInterval, type PlanMeter, type PlanMeterTier, type PlanRequiredTerms, ReoptPlansClient, createReoptPlansClient };
@@ -1,3 +1,3 @@
1
- import { n as createReoptPlansClient, t as ReoptPlansClient } from "../client-DE3FvPFs.js";
1
+ import { n as createReoptPlansClient, t as ReoptPlansClient } from "../client-BVvAfEXG.js";
2
2
 
3
3
  export { ReoptPlansClient, createReoptPlansClient };
@@ -1,2 +1,2 @@
1
- import { a as RegisterPushTokenInput, c as UnregisterPushTokenInput, i as PushProvider, l as UnregisterPushTokenResult, n as createReoptPushClient, o as RegisterPushTokenResult, r as PushPlatform, s as RegisteredPushDevice, t as ReoptPushClient } from "../client-DfEeaOsQ.js";
1
+ import { a as RegisterPushTokenInput, c as UnregisterPushTokenInput, i as PushProvider, l as UnregisterPushTokenResult, n as createReoptPushClient, o as RegisterPushTokenResult, r as PushPlatform, s as RegisteredPushDevice, t as ReoptPushClient } from "../client-bXAnGNzC.js";
2
2
  export { type PushPlatform, type PushProvider, type RegisterPushTokenInput, type RegisterPushTokenResult, type RegisteredPushDevice, ReoptPushClient, type UnregisterPushTokenInput, type UnregisterPushTokenResult, createReoptPushClient };
@@ -1,3 +1,3 @@
1
- import { n as createReoptPushClient, t as ReoptPushClient } from "../client-D_7G37OB.js";
1
+ import { n as createReoptPushClient, t as ReoptPushClient } from "../client-D4kUDFwW.js";
2
2
 
3
3
  export { ReoptPushClient, createReoptPushClient };
@@ -1,4 +1,4 @@
1
- import { x as ReoptSDKError } from "./config-tEsB7QhQ.js";
1
+ import { S as ReoptSDKError } from "./config-D8dSL6OQ.js";
2
2
 
3
3
  //#region src/core/query.ts
4
4
  /**
@@ -32,4 +32,4 @@ function buildQuery(params) {
32
32
 
33
33
  //#endregion
34
34
  export { buildQuery as t };
35
- //# sourceMappingURL=query-Bsgb85OE.js.map
35
+ //# sourceMappingURL=query-C18XolkY.js.map
@@ -1,9 +1,9 @@
1
- import { C as EavEntity, D as ListRecordsQuery, M as UpsertRecordInput, N as UpsertRecordResult, O as PaginatedResponse, b as EavAttribute, j as UpdateRecordInput, m as BulkUpdateItem, v as CreateRecordInput, w as EavRecord, y as DeleteWhereInput } from "../config-C7WQtC3l.js";
2
- import { a as CompletionOptions, f as ModelInfo, l as ImageGenerateOptions, o as CompletionResult, p as StreamDoneData, r as AgentInfo, s as CreditInfo, u as ImageGenerateResult } from "../client-DPbXH8tr.js";
3
- import { _ as ReoptSDKError } from "../errors-CRCcErNC.js";
1
+ import { A as ListRecordsQuery, C as EavAttribute, D as EavRecord, E as EavEntity, F as UpsertRecordInput, I as UpsertRecordResult, P as UpdateRecordInput, S as DeleteWhereInput, _ as BulkUpdateItem, j as PaginatedResponse, x as CreateRecordInput } from "../config-D28P8iwm.js";
2
+ import { a as CompletionOptions, f as ModelInfo, l as ImageGenerateOptions, o as CompletionResult, p as StreamDoneData, r as AgentInfo, s as CreditInfo, u as ImageGenerateResult } from "../client-DA9ibl3G.js";
3
+ import { v as ReoptSDKError } from "../errors-U3TsyWVq.js";
4
4
  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";
5
- import { a as FileListQuery, c as FolderInfo, d as UpdateFolderInput, f as UploadOptions, i as FileInfo, l as FolderListQuery, o as FileListResponse, r as CreateFolderInput, s as FileUsageInfo, u as UpdateFileInput } from "../client-A4YrHjDc.js";
6
- import { t as ReoptSDK } from "../index-DJMr3ixA.js";
5
+ import { a as FileListQuery, c as FolderInfo, d as UpdateFolderInput, f as UploadOptions, i as FileInfo, l as FolderListQuery, o as FileListResponse, r as CreateFolderInput, s as FileUsageInfo, u as UpdateFileInput } from "../client-BOEyVc8V.js";
6
+ import { t as ReoptSDK } from "../index-DwIr8W3Y.js";
7
7
  import { UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
8
8
  //#region src/react/use-ai-stream.d.ts
9
9
  type UseAiStreamOptions = {
@@ -200,7 +200,7 @@ declare function useBulkDeleteRecords(sdk: ReoptSDK, entityId: string, options?:
200
200
  */
201
201
  declare function useDeleteRecordsWhere(sdk: ReoptSDK, entityId: string, options?: UseMutationOptions<number, Error, DeleteWhereInput>): UseMutationResult<number, Error, DeleteWhereInput>;
202
202
  /**
203
- * BrandApp AI 크레딧 잔액 조회
203
+ * BrandApp AI 사용량 잔액 조회
204
204
  *
205
205
  * @example
206
206
  * ```tsx
@@ -536,7 +536,7 @@ function useDeleteRecordsWhere(sdk, entityId, options) {
536
536
  });
537
537
  }
538
538
  /**
539
- * BrandApp AI 크레딧 잔액 조회
539
+ * BrandApp AI 사용량 잔액 조회
540
540
  *
541
541
  * @example
542
542
  * ```tsx
@@ -1,3 +1,3 @@
1
1
  import { a as CreateConsentsResult, c as TermsJurisdiction, d as TermsVersion, f as WithdrawConsentResult, i as CreateConsentsRequest, l as TermsListResponse, n as ConsentRecord, o as ListTermsOptions, r as ConsentStatus, s as TermsItem, t as ConsentInput, u as TermsType } from "../types-C69OzBn6.js";
2
- import { n as createReoptTermsClient, t as ReoptTermsClient } from "../client-DHZ484kb.js";
2
+ import { n as createReoptTermsClient, t as ReoptTermsClient } from "../client-BBxhqs8l.js";
3
3
  export { type ConsentInput, type ConsentRecord, type ConsentStatus, type CreateConsentsRequest, type CreateConsentsResult, type ListTermsOptions, ReoptTermsClient, type TermsItem, type TermsJurisdiction, type TermsListResponse, type TermsType, type TermsVersion, type WithdrawConsentResult, createReoptTermsClient };
@@ -1,3 +1,3 @@
1
- import { n as createReoptTermsClient, t as ReoptTermsClient } from "../client-Dnp7_J0-.js";
1
+ import { n as createReoptTermsClient, t as ReoptTermsClient } from "../client-BpEWDfSl.js";
2
2
 
3
3
  export { ReoptTermsClient, createReoptTermsClient };
@@ -1,5 +1,5 @@
1
- import { a as SeedAllInput, c as SeedPostGroupInput, d as SeedTermsItem, l as SeedPostInput, n as DevServer, o as SeedData, t as DevSchema } from "../index-DV_OWwx5.js";
2
- import { t as ReoptSDK } from "../index-DJMr3ixA.js";
1
+ import { a as SeedAllInput, c as SeedPostGroupInput, d as SeedTermsItem, l as SeedPostInput, n as DevServer, o as SeedData, t as DevSchema } from "../index-C6fyJTud.js";
2
+ import { t as ReoptSDK } from "../index-DwIr8W3Y.js";
3
3
  //#region src/testing/index.d.ts
4
4
  type TestSDKOptions = {
5
5
  /** EAV schema to seed entities and attributes */
@@ -378,6 +378,42 @@ await sdk.eav.records.bulkCreate(entityId, items);
378
378
  await sdk.eav.records.bulkUpdate(entityId, items);
379
379
  await sdk.eav.records.bulkDelete(entityId, ids);
380
380
 
381
+ // 동시성·TTL 원시연산 (brandapp 자유 테이블 전용)
382
+ const current = await sdk.eav.records.get(entityId, recordId); // current.version
383
+ await sdk.eav.records.update(entityId, recordId, {
384
+ values: { [statusAttr]: "done" },
385
+ ifVersion: current.version, // 그 사이 다른 쓰기가 있었으면 412 PreconditionFailedError
386
+ });
387
+ await sdk.eav.records.update(entityId, recordId, {
388
+ increments: { [balanceAttr]: -30 }, // number 속성 원자 가감 — values 없이도 된다
389
+ });
390
+ await sdk.eav.records.create(entityId, {
391
+ values: { [keyAttr]: "lease:job-42" }, // isUnique 속성 + TTL = claim/lease
392
+ expiresAt: new Date(Date.now() + 60_000).toISOString(),
393
+ });
394
+ await sdk.eav.records.update(entityId, recordId, { expiresAt: null }); // TTL 해제
395
+ // ⚠️ expiresAt는 클라이언트가 계산한 절대 시각이다 — 서버 수신 시각 기준이 아니다.
396
+ // 콜드스타트 create가 수 초 걸릴 수 있으니(실측 3.7초) 초 단위 짧은 TTL은 그만큼 여유를 둘 것.
397
+ ```
398
+
399
+ ### 한도 (production API 기준, 2026-08-30)
400
+
401
+ | 항목 | 값 | 초과 시 |
402
+ | ------------------------- | -------------------------------------------------------------------------------------------------- | ------------------------------ |
403
+ | 엔티티/브랜드앱 | 무제한 (운영자 opt-in `BRANDAPP_EAV_MAX_ENTITIES`) | `LIMIT_EXCEEDED_ENTITIES` |
404
+ | 속성/엔티티 | 100 | `LIMIT_EXCEEDED_ATTRIBUTES` |
405
+ | 레코드/엔티티 | 10,000 기본 (운영자 `BRANDAPP_EAV_MAX_RECORDS_PER_ENTITY`로 인상) — 만료 행 제외 | `LIMIT_EXCEEDED_RECORDS` (422) |
406
+ | 인메모리 후보 상한 | 10,000행 — 필터가 SQL로 못 내려가는 요청(`neq`/`not_in`/`after`/`before`, 커스텀 속성 정렬)만 해당 | `QUERY_TOO_BROAD` (422) |
407
+ | `list` limit | 최대 100, 기본 50 | 400 |
408
+ | bulk create/update/delete | 호출당 100건 | 400 |
409
+ | 레코드 값 직렬화 | 128KB/레코드 | `VALIDATION_ERROR` (422) |
410
+ | 엔티티·속성 name/label | 100자, description 500자 | 400 |
411
+
412
+ `eq`·`in`·`is_null`·`is_not_null`·`contains`·범위(`gt/lt/gte/lte`)는 GIN 인덱스로 후보를
413
+ 좁히므로 엔티티 크기와 무관하게 싸다. 부재 속성은 `is_null`에 매치된다(`null` 값과 동일).
414
+
415
+ ```typescript
416
+
381
417
  // Pagination (async generator)
382
418
  for await (const record of sdk.eav.records.listAll(entityId)) { ... }
383
419
  ```
@@ -396,7 +432,8 @@ where("deletedAt").isNull();
396
432
  const w = createFilterBuilder(ATTRIBUTE_IDS.contacts);
397
433
  w("status").eq("active"); // TypeScript validates field names
398
434
 
399
- // Operators: eq, neq, contains, gt, lt, gte, lte, isNull, isNotNull, after, before
435
+ // Operators: eq, neq, in, notIn, contains, gt, lt, gte, lte, isNull, isNotNull, after, before
436
+ // in/notIn은 빈 배열을 받지 않는다(400) — "제외 없음"은 필터를 빼서 표현한다.
400
437
  ```
401
438
 
402
439
  ## Schema & JSON Schema
@@ -87,7 +87,7 @@ await dev.seed({
87
87
  | --------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
88
88
  | **EAV** | `/api/v1/brandapp/{id}/eav/*` | Entity/Attribute/Record CRUD + 벌크 + 필터링 + 정렬 |
89
89
  | **Auth** | `/api/v1/brandapp/{id}/auth/adapter` | Better Auth 어댑터 (user/session/account/verification CRUD) |
90
- | **AI** | `/api/v1/brandapp/{id}/ai/*` | Mock 텍스트/이미지 생성, 모델 목록, 크레딧 |
90
+ | **AI** | `/api/v1/brandapp/{id}/ai/*` | Mock 텍스트/이미지 생성, 모델 목록, 사용량 |
91
91
  | **Files** | `/api/v1/brandapp/{id}/files/*` | 인메모리 파일 업로드/다운로드/삭제 |
92
92
  | **CMS** | `/api/v1/brandapp/{id}/cms/*` | Post/PostGroup CRUD |
93
93
  | **OAuth** | `/api/auth/.well-known/*`, `/api/auth/{token,jwks,oauth2/end-session}` | OIDC Discovery + EdDSA로 서명된 mock `id_token` + JWKS + RP-initiated end-session (faithful OIDC mock) |
package/docs/errors.md CHANGED
@@ -50,7 +50,7 @@ treating a transient JWKS outage as a permanently bad token). See
50
50
  `sdk.files.*` 도메인 코드. 409는 `ConflictError`로, 413/415는 base
51
51
  `ReoptSDKError`로 도착한다 — `.code`/`.status`로 분기하면 된다. ⚠️ 402는 클래스
52
52
  매핑이 status 단위라 저장공간 초과도 **`CreditLimitError` 클래스**로 도착한다
53
- (이름과 달리 AI 크레딧이 아님) — `.code === "STORAGE_LIMIT"`으로 구분할 것.
53
+ (이름과 달리 AI 사용량이 아님) — `.code === "STORAGE_LIMIT"`으로 구분할 것.
54
54
 
55
55
  | Code | Status | Class | When |
56
56
  | -------------------------- | ------ | ------------------ | ------------------------------------------------------------------------ |
@@ -70,24 +70,26 @@ These extend the general classes above so existing `instanceof ConflictError` /
70
70
  `instanceof BadRequestError` checks keep working — narrower classes just give
71
71
  you a more direct branch when you care about the specific case.
72
72
 
73
- | Error Class | Extends | Status | Code | When |
74
- | --------------------------- | --------------- | ------- | ------------------------- | ----------------------------------------------------------- |
75
- | `AuthUserRecordExistsError` | `ConflictError` | 409 | `AUTH_USER_RECORD_EXISTS` | 1:1 메타 entity에 같은 user의 record가 이미 있음 (→ upsert) |
76
- | `DuplicateAuthUserError` | `ConflictError` | 409 | `DUPLICATE_AUTH_USER` | bulk create 입력에 같은 authUserId가 중복 |
77
- | `AuthUserNotFoundError` | `ReoptSDKError` | 400/422 | `AUTH_USER_NOT_FOUND` | 참조한 authUserId가 이 brandapp에 없음 |
78
- | `LimitExceededError` | `ReoptSDKError` | 422 | `LIMIT_EXCEEDED_*` | EAV 자원 한도 초과 (entity/attribute/record) |
73
+ | Error Class | Extends | Status | Code | When |
74
+ | --------------------------- | --------------- | ------- | ------------------------- | ------------------------------------------------------------------------------- |
75
+ | `AuthUserRecordExistsError` | `ConflictError` | 409 | `AUTH_USER_RECORD_EXISTS` | 1:1 메타 entity에 같은 user의 record가 이미 있음 (→ upsert) |
76
+ | `DuplicateAuthUserError` | `ConflictError` | 409 | `DUPLICATE_AUTH_USER` | bulk create 입력에 같은 authUserId가 중복 |
77
+ | `AuthUserNotFoundError` | `ReoptSDKError` | 400/422 | `AUTH_USER_NOT_FOUND` | 참조한 authUserId가 이 brandapp에 없음 |
78
+ | `LimitExceededError` | `ReoptSDKError` | 422 | `LIMIT_EXCEEDED_*` | EAV 자원 한도 초과 (entity/attribute/record) |
79
+ | `PreconditionFailedError` | `ReoptSDKError` | 412 | `PRECONDITION_FAILED` | `records.update(..., { ifVersion })`의 version이 현재와 다름 — 다시 읽고 재시도 |
79
80
 
80
81
  추가 EAV 코드 (전용 클래스 없이 일반 클래스 + `.code`로 분기):
81
82
 
82
- | Code | Status | Class | Notes |
83
- | ----------------------- | ------ | ----------------- | ---------------------------------------------------------- |
84
- | `ENTITY_NOT_FOUND` | 404 | `NotFoundError` | URL의 entityId가 이 brandapp 소속이 아님 |
85
- | `ATTRIBUTE_NOT_FOUND` | 404 | `NotFoundError` | URL의 attributeId가 entity 소속이 아님 |
86
- | `RECORD_NOT_FOUND` | 404 | `NotFoundError` | URL의 recordId가 entity 소속이 아님 |
87
- | `USER_NOT_FOUND` | 404 | `NotFoundError` | `/users/:authUserId/records` 경로의 user가 brandapp에 없음 |
88
- | `RECORDS_NOT_FOUND` | 400 | `BadRequestError` | bulkUpdate에서 일부 record id가 entity에 없음 |
89
- | `DUPLICATE_RECORD_ID` | 409 | `ConflictError` | bulkUpdate(brandappAuthUser) 입력에 같은 record id가 중복 |
90
- | `AUTH_USER_ID_REQUIRED` | 400 | `BadRequestError` | `linkedTo='brandappAuthUser'` entity인데 authUserId 누락 |
83
+ | Code | Status | Class | Notes |
84
+ | ----------------------- | ------ | ----------------- | -------------------------------------------------------------------------- |
85
+ | `ENTITY_NOT_FOUND` | 404 | `NotFoundError` | URL의 entityId가 이 brandapp 소속이 아님 |
86
+ | `ATTRIBUTE_NOT_FOUND` | 404 | `NotFoundError` | URL의 attributeId가 entity 소속이 아님 |
87
+ | `RECORD_NOT_FOUND` | 404 | `NotFoundError` | URL의 recordId가 entity 소속이 아님 |
88
+ | `USER_NOT_FOUND` | 404 | `NotFoundError` | `/users/:authUserId/records` 경로의 user가 brandapp에 없음 |
89
+ | `RECORDS_NOT_FOUND` | 400 | `BadRequestError` | bulkUpdate에서 일부 record id가 entity에 없음 |
90
+ | `DUPLICATE_RECORD_ID` | 409 | `ConflictError` | bulkUpdate(brandappAuthUser) 입력에 같은 record id가 중복 |
91
+ | `QUERY_TOO_BROAD` | 422 | `ReoptSDKError` | 필터 후보가 인메모리 상한(10k행)을 넘음 — `eq`/`in`/`authUserId`로 좁힐 것 |
92
+ | `AUTH_USER_ID_REQUIRED` | 400 | `BadRequestError` | `linkedTo='brandappAuthUser'` entity인데 authUserId 누락 |
91
93
 
92
94
  All classes extend `ReoptSDKError`, so `instanceof ReoptSDKError` and
93
95
  `isReoptSDKError(err)` match every SDK error.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reopt-ai/brandapp-sdk",
3
- "version": "4.1.0",
3
+ "version": "4.3.0",
4
4
  "description": "Reopt Brandapp SDK — Better Auth adapter, OAuth login, and EAV client",
5
5
  "author": "Reopt",
6
6
  "license": "MIT",