@reopt-ai/brandapp-sdk 4.7.0-rc.13 → 4.7.0-rc.15

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 (71) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/ai/index.d.ts +1 -1
  3. package/dist/ai/index.js +2 -2
  4. package/dist/ai-provider/index.d.ts +1 -1
  5. package/dist/ai-provider/index.js +1 -1
  6. package/dist/analytics/index.d.ts +1 -1
  7. package/dist/analytics/index.js +1 -1
  8. package/dist/auth/index.d.ts +1 -1
  9. package/dist/auth/index.js +1 -1
  10. package/dist/better-auth/index.d.ts +1 -1
  11. package/dist/better-auth/index.js +2 -2
  12. package/dist/{client-BbmslwWV.d.ts → client-33gSO7lm.d.ts} +2 -2
  13. package/dist/{client-B2nwOzdZ.js → client-5N6dGCPl.js} +3 -3
  14. package/dist/{client-BBfRO86C.js → client-5Z8ekxae.js} +3 -3
  15. package/dist/{client-Dwf6UuGH.d.ts → client-8phVQcw8.d.ts} +2 -2
  16. package/dist/{client-RnJg4AGr.js → client-B9_zWxmn.js} +2 -2
  17. package/dist/{client-CJFsLk3_.d.ts → client-BY0-0nhP.d.ts} +2 -2
  18. package/dist/{client-BF94tdhy.js → client-BjX5K-Qh.js} +166 -29
  19. package/dist/{client-v7ed6KdC.js → client-BlHPiBEo.js} +2 -2
  20. package/dist/{client-CD6uK0dA.d.ts → client-BrYt--zm.d.ts} +2 -2
  21. package/dist/{client-DF-tOyrY.d.ts → client-C08BvY3B.d.ts} +2 -2
  22. package/dist/{client-NUhpPkl2.d.ts → client-C2Yhtnhs.d.ts} +2 -2
  23. package/dist/{client-wNzcgEJu.d.ts → client-CTNoB_vH.d.ts} +2 -2
  24. package/dist/{client-BL-Ljwki.d.ts → client-CUdewN3W.d.ts} +2 -2
  25. package/dist/{client-CDeaH7JC.js → client-Ce3RqyOI.js} +2 -2
  26. package/dist/{client-Do7Eny_J.js → client-DCd3T29e.js} +3 -3
  27. package/dist/{client-CP1Jgq4R.d.ts → client-DD9y7Qew.d.ts} +2 -2
  28. package/dist/{client-CoaQxuaG.js → client-DIAWwOhv.js} +2 -2
  29. package/dist/{client-DoK8YCd_.js → client-DbbbBNJm.js} +2 -2
  30. package/dist/{client-BvgSoqAc.js → client-Dg-hO_LG.js} +2 -2
  31. package/dist/{client-CJRjPSf7.d.ts → client-QPvDSMNd.d.ts} +59 -15
  32. package/dist/{client-Ca_5meV_.js → client-Ylv0P82v.js} +2 -2
  33. package/dist/{client-D38XGQRR.js → client-aB1rCHah.js} +4 -4
  34. package/dist/cms/index.d.ts +1 -1
  35. package/dist/cms/index.js +1 -1
  36. package/dist/{config-BGT9h1OW.d.ts → config-CSUlKyTp.d.ts} +7 -3
  37. package/dist/{config-Cxv010M9.js → config-ChctVyuz.js} +2 -2
  38. package/dist/dev/index.js +49 -10
  39. package/dist/eav/index.d.ts +23 -20
  40. package/dist/eav/index.js +6 -3
  41. package/dist/eav/migrate.d.ts +2 -2
  42. package/dist/eav/schema.d.ts +2 -2
  43. package/dist/eav/schema.js +1 -1
  44. package/dist/feedback/index.d.ts +1 -1
  45. package/dist/feedback/index.js +1 -1
  46. package/dist/files/index.d.ts +12 -1
  47. package/dist/files/index.js +14 -1
  48. package/dist/{http-client-COcHWJzo.js → http-client-CpG8mEHO.js} +2 -2
  49. package/dist/{index-CaXrNTtU.d.ts → index-tEgiKb5o.d.ts} +12 -12
  50. package/dist/index.d.ts +4 -4
  51. package/dist/index.js +12 -12
  52. package/dist/installation/index.js +3 -3
  53. package/dist/logout/index.d.ts +1 -1
  54. package/dist/logout/index.js +1 -1
  55. package/dist/machine/index.js +1 -1
  56. package/dist/plans/index.d.ts +1 -1
  57. package/dist/plans/index.js +1 -1
  58. package/dist/push/index.d.ts +1 -1
  59. package/dist/push/index.js +1 -1
  60. package/dist/{query-Ch_JZ5Bd.js → query-DFwpKnPG.js} +2 -2
  61. package/dist/react/hooks.d.ts +4 -4
  62. package/dist/social/index.js +1 -1
  63. package/dist/terms/index.d.ts +1 -1
  64. package/dist/terms/index.js +1 -1
  65. package/dist/testing/index.d.ts +1 -1
  66. package/dist/workspace/index.js +1 -1
  67. package/docs/api-reference.md +2 -1
  68. package/docs/dev-server.md +6 -1
  69. package/docs/files.md +6 -1
  70. package/docs/testing.md +4 -4
  71. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -7,6 +7,54 @@ This project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [4.7.0-rc.15] — 2026-11-20
11
+
12
+ Pre-release (`npm i @reopt-ai/brandapp-sdk@next`) — rc.14 타입 클라이언트의 타입 갭 둘(enterprise-bootstrap 보고).
13
+ 런타임 동작은 rc.14와 같다.
14
+
15
+ ### Changed
16
+
17
+ - **`entity()`의 속성 참조가 스키마 이름으로 좁혀진다** — `filters[].attributeId`·`sortBy`·`select`·`increments`가
18
+ `string`이 아니라 그 엔티티의 속성 이름이라 오타가 컴파일 에러가 된다(rc.14는 런타임 `UNKNOWN_ATTRIBUTE`뿐).
19
+ `where("name")`이 리터럴 이름을 유지하도록 `where`·`FilterExpression`·`AttributeFilter`가 키 타입 인자를 받는다
20
+ (기본값 `string`이라 원시 API·`createFilterBuilder`는 그대로). 스키마 없이 만든 SDK는 종전처럼 아무 문자열이나
21
+ 받는다. ⚠️ 타입 클라이언트에 속성 ID를 키로 넘기던 코드는 런타임에선 여전히 통하지만 타입은 이름만 받는다.
22
+ - **`update`·`bulkUpdate`·`backfill`의 값에 `null`을 쓸 수 있다**(`TypedPatch` — 값 지우기, 서버가 받는다).
23
+ `exactOptionalPropertyTypes`에서도 캐스트가 필요 없다.
24
+ - 새 공개 타입: `TypedPatch`, `TypedAttributeFilter`, `TypedListQuery`, `TypedCountQuery`, `TypedDeleteWhereInput`,
25
+ `TypedUpdateInput`, `TypedBackfillOptions`, `AttributeName`(`@reopt-ai/brandapp-sdk/eav`).
26
+
27
+ ## [4.7.0-rc.14] — 2026-11-20
28
+
29
+ Pre-release (`npm i @reopt-ai/brandapp-sdk@next`) — 타입 EAV 클라이언트(`sdk.eav.entity(name)`)가 실서버에서
30
+ 쓰기를 조용히 잃던 결함을 고친다. 🔴 rc.13 이하에서 `entity()`로 값을 썼다면 실서버에는 아무것도 저장되지 않았다
31
+ (아래 Fixed 첫 항목).
32
+
33
+ ### Fixed
34
+
35
+ - **`sdk.eav.entity(name)`가 속성 이름을 속성 ID로 바꿔 보낸다.** 서버는 레코드 값·필터·`sortBy`·`select`를 속성
36
+ ID로만 읽고 모르는 키는 말없이 버린다. 그런데 타입 클라이언트는 이름 키(`values: { title }`)를 그대로 보냈다 —
37
+ 생성은 필수값 누락 422, 조회 결과는 ID 키라 `record.values.title`이 `undefined`, **수정은 200을 돌려주고 아무것도
38
+ 바꾸지 않았다**. 이제 `values`·`increments`·`filters[].attributeId`(`where("name")` 포함)·`sortBy`·`select`를
39
+ 이름 → ID로 바꿔 보내고, 응답 레코드의 `values`를 ID → 이름으로 돌려준다(`backfill`의 `transform`도 이름 키로
40
+ 받고 이름 키로 돌려준다). 속성 ID를 키로 넘겨도 그대로 통한다(우회해 둔 코드가 깨지지 않는다).
41
+ 모르는 키는 서버에 보내기 전에 `UNKNOWN_ATTRIBUTE`(`BadRequestError`)로 거절한다 — 스키마가 바뀐 직후일 수 있어
42
+ 엔티티를 한 번 다시 읽은 뒤에 판정한다. 엔티티 속성 목록은 엔티티 이름 캐시와 함께 5분 캐시된다.
43
+ ⚠️ 응답의 `values`가 이름 키가 됐다 — rc.13에서 `entity()` 결과를 `values[attributeId]`로 읽어 우회했다면
44
+ `values.<이름>`으로 바꾼다. ID 키 원시 API(`sdk.eav.records.*`)는 바뀌지 않았다.
45
+ - **dev 서버가 속성 ID를 실서버처럼 따로 발급한다.** 지금까지는 속성 이름을 ID로 써서 위 결함이 로컬에서
46
+ 드러나지 않았고, 한 전역 맵에 넣어 서로 다른 엔티티의 같은 이름 속성(예: 두 엔티티의 `title`)이 마지막 것으로
47
+ 덮였다. 레코드 값도 실서버처럼 그 엔티티의 속성 ID가 아닌 키를 버린다. `dev.seed()`·`seedAll`은 종전대로 이름
48
+ 키를 받는다(ID로 바꿔 저장). ⚠️ dev 서버에 원시 HTTP·ID 키 API로 이름 키를 보내던 테스트는 실서버와 같이
49
+ 값이 버려진다 — `entity()`를 쓰거나 `GET /entities/:id`의 속성 ID로 바꾼다.
50
+ - **`eav sync`가 선언하지 않은 `icon`을 변경으로 보지 않는다.** 서버는 icon 없이 만든 엔티티에 기본값(📊)을
51
+ 넣는데, diff가 "미선언 = null"로 읽어 매 dry-run마다 `icon: null` 갱신을 내놓았다. 이제 `defineEntity`에
52
+ `icon`을 적었을 때만 맞춘다(서버의 icon을 지우려면 다른 값을 선언한다).
53
+ - **`REOPT_IMAGE_REMOTE_PATTERNS`에 실제 파일 호스트를 넣었다** — `sdk.files`가 돌려주는 `url`은
54
+ `https://studio.reopt.ai/api/blob/...`(리옵트 서빙 프록시)인데 목록에는 Vercel Blob 호스트만 있어 `next/image`가
55
+ 거절했다. `ImageRemotePattern`에 `pathname`이 생겼다. 로컬(`studio.local.reopt.io`)은 루프백이라 Next.js가
56
+ 패턴과 무관하게 거절한다 — `docs/files.md` 참고.
57
+
10
58
  ## [4.7.0-rc.13] — 2026-11-08
11
59
 
12
60
  Pre-release (`npm i @reopt-ai/brandapp-sdk@next`) — 앱 심사용 번호를 리옵트 콘솔로 옮기고, 전화번호 정본을 E.164로
@@ -1,4 +1,4 @@
1
- import { C as StreamEvent, S as StreamDoneData, _ as ImageGenerateOptions, a as CompletionContentPart, b as ModelInfo, c as CompletionUsage, d as EvaluateOptions, f as EvaluationAnswer, g as FinishReason, h as EvaluationResult, i as ChatMessage, l as CompletionWarning, m as EvaluationQuestion, n as createReoptAiClient, o as CompletionOptions, p as EvaluationInput, r as AgentInfo, s as CompletionResult, t as ReoptAiClient, u as CreditInfo, v as ImageGenerateResult, x as PartProviderMetadata, y as MessageRole } from "../client-CP1Jgq4R.js";
1
+ import { C as StreamEvent, S as StreamDoneData, _ as ImageGenerateOptions, a as CompletionContentPart, b as ModelInfo, c as CompletionUsage, d as EvaluateOptions, f as EvaluationAnswer, g as FinishReason, h as EvaluationResult, i as ChatMessage, l as CompletionWarning, m as EvaluationQuestion, n as createReoptAiClient, o as CompletionOptions, p as EvaluationInput, r as AgentInfo, s as CompletionResult, t as ReoptAiClient, u as CreditInfo, v as ImageGenerateResult, x as PartProviderMetadata, y as MessageRole } from "../client-DD9y7Qew.js";
2
2
  //#region src/ai/evaluator.d.ts
3
3
  /**
4
4
  * json-render `experimental_composeSpec`의 `evaluate`와 같은 모양(0.21 `Experimental_CompositionEvaluator`).
package/dist/ai/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { S as ReoptSDKError } from "../config-Cxv010M9.js";
2
- import { n as createReoptAiClient, t as ReoptAiClient } from "../client-D38XGQRR.js";
1
+ import { S as ReoptSDKError } from "../config-ChctVyuz.js";
2
+ import { n as createReoptAiClient, t as ReoptAiClient } from "../client-aB1rCHah.js";
3
3
 
4
4
  //#region src/ai/evaluator.ts
5
5
  function createBrandappEvaluator(source, options = {}) {
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "../config-BGT9h1OW.js";
1
+ import { n as ReoptSDKConfig } from "../config-CSUlKyTp.js";
2
2
  import { Experimental_DecisionModelV4, Experimental_DecisionModelV4CallOptions, Experimental_DecisionModelV4Result, ImageModelV3, ImageModelV3CallOptions, LanguageModelV3, LanguageModelV3CallOptions, LanguageModelV3GenerateResult, LanguageModelV3StreamResult, ProviderV3 } from "@ai-sdk/provider";
3
3
  //#region src/ai-provider/brandapp-language-model.d.ts
4
4
  type BrandappLanguageModelConfig = {
@@ -1,4 +1,4 @@
1
- import { i as resolveBaseUrl, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, r as assertBrowserSafe } from "../config-Cxv010M9.js";
1
+ import { i as resolveBaseUrl, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, r as assertBrowserSafe } from "../config-ChctVyuz.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-D65dmL4A.js";
@@ -1,4 +1,4 @@
1
- import { n as createReoptAnalyticsClient, r as AnalyticsConfig, t as ReoptAnalyticsClient } from "../client-CJFsLk3_.js";
1
+ import { n as createReoptAnalyticsClient, r as AnalyticsConfig, t as ReoptAnalyticsClient } from "../client-BY0-0nhP.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-DoK8YCd_.js";
1
+ import { n as createReoptAnalyticsClient, t as ReoptAnalyticsClient } from "../client-DbbbBNJm.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-BL-Ljwki.js";
1
+ import { i as UserInfoClaims, n as createReoptAuthClient, r as LinkCurrentUserResult, t as ReoptAuthClient } from "../client-CUdewN3W.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-Ca_5meV_.js";
1
+ import { n as createReoptAuthClient, t as ReoptAuthClient } from "../client-Ylv0P82v.js";
2
2
 
3
3
  //#region src/auth/session.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig, t as REOPT_BASE_URLS } from "../config-BGT9h1OW.js";
1
+ import { n as ReoptSDKConfig, t as REOPT_BASE_URLS } from "../config-CSUlKyTp.js";
2
2
  import { a as REOPT_PROVIDER_IDS, i as REOPT_PROVIDER_ID, n as AdapterRequestBody, o as REOPT_STEP_UP_PROVIDER_ID, r as REOPT_DEFAULT_SCOPES, s as STEP_UP_MAX_AUTH_AGE_SECONDS, t as AdapterOperation } from "../types-FazBnzhg.js";
3
3
  import { i as ClientPrivateJwk } from "../keys-B2pA8EkU.js";
4
4
  import { T as isReoptSDKError, _ as RateLimitError, t as AuthError, v as ReoptSDKError, x as ServerError } from "../errors-D-Va8oeC.js";
@@ -1,5 +1,5 @@
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-Cxv010M9.js";
2
- import { t as BaseHttpClient } from "../http-client-COcHWJzo.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-ChctVyuz.js";
2
+ import { t as BaseHttpClient } from "../http-client-CpG8mEHO.js";
3
3
  import { o as readClientKeyRing } from "../keys-B_R_lsyF.js";
4
4
  import { a as STEP_UP_MAX_AUTH_AGE_SECONDS, i as REOPT_STEP_UP_PROVIDER_ID, n as REOPT_PROVIDER_ID, r as REOPT_PROVIDER_IDS, t as REOPT_DEFAULT_SCOPES } from "../types-DGAVaUCc.js";
5
5
  import { createAdapterFactory } from "better-auth/adapters";
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-BGT9h1OW.js";
1
+ import { n as ReoptSDKConfig } from "./config-CSUlKyTp.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-BbmslwWV.d.ts.map
53
+ //# sourceMappingURL=client-33gSO7lm.d.ts.map
@@ -1,6 +1,6 @@
1
- import { n as SDK_VERSION } from "./config-Cxv010M9.js";
1
+ import { n as SDK_VERSION } from "./config-ChctVyuz.js";
2
2
  import { o as readClientKeyRing } from "./keys-B_R_lsyF.js";
3
- import { r as createMachineClient } from "./client-CDeaH7JC.js";
3
+ import { r as createMachineClient } from "./client-Ce3RqyOI.js";
4
4
  import { z } from "zod";
5
5
 
6
6
  //#region src/workspace/schemas.ts
@@ -742,4 +742,4 @@ function createPlatformClient(config) {
742
742
 
743
743
  //#endregion
744
744
  export { platformWebhookUpsertInputSchema as $, platformEavSchemaOperationSchema as A, platformPipelineResourceSchema as B, platformBrandappResourceSchema as C, platformEavEntityResourceSchema as D, platformEavBrandappResourcesSchema as E, platformMeSchema as F, platformResourcesSchema as G, platformPipelineStageInputSchema as H, platformOAuthClientImportInputSchema as I, platformTaskStageInputSchema as J, platformResourcesV2Schema as K, platformOAuthClientResourceSchema as L, platformExternalIdSchema as M, platformLockAcquiredSchema as N, platformEavSchemaApplyInputSchema as O, platformLockReleasedSchema as P, platformWebhookSchema as Q, platformOAuthClientUpsertInputSchema as R, platformBrandUpsertInputSchema as S, platformCustomerUpsertInputSchema as T, platformPipelineUpsertInputSchema as U, platformPipelineSchema as V, platformResourceKeySchema as W, platformTaskUpsertInputSchema as X, platformTaskStageSchema as Y, platformWebhookResourceSchema as Z, PLATFORM_TASK_PRIORITIES as _, createPlatformClient as a, platformBrandImportInputSchema as b, PLATFORM_ADMIN_SCOPE as c, PLATFORM_MANAGED_BY_VALUES as d, platformWorkTaskStageChangedEventSchema as et, PLATFORM_OAUTH_APPLICATION_TYPES as f, PLATFORM_TASK_OUTCOMES as g, PLATFORM_STAGE_COLORS as h, REOPT_PLATFORM_URLS as i, platformErrorSchema as j, platformEavSchemaApplyResultSchema as k, PLATFORM_BRANDAPP_STATUSES as l, PLATFORM_OAUTH_GRANT_TYPES as m, PlatformApiError as n, createPlatformRequester as o, PLATFORM_OAUTH_CLIENT_PURPOSES as p, platformTaskSchema as q, REOPT_PLATFORM_ID_URLS as r, resolvePlatformUrls as s, DEFAULT_PLATFORM_SCOPES as t, platformWriteMetaSchema as tt, PLATFORM_DOMAIN_STATUSES as u, PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS as v, platformBrandappUpsertInputSchema as w, platformBrandResourceSchema as x, PLATFORM_WEBHOOK_TRIGGERS as y, platformPipelineImportInputSchema as z };
745
- //# sourceMappingURL=client-B2nwOzdZ.js.map
745
+ //# sourceMappingURL=client-5N6dGCPl.js.map
@@ -1,5 +1,5 @@
1
- import { t as BaseHttpClient } from "./http-client-COcHWJzo.js";
2
- import { t as buildQuery } from "./query-Ch_JZ5Bd.js";
1
+ import { t as BaseHttpClient } from "./http-client-CpG8mEHO.js";
2
+ import { t as buildQuery } from "./query-DFwpKnPG.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-BBfRO86C.js.map
55
+ //# sourceMappingURL=client-5Z8ekxae.js.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-BGT9h1OW.js";
1
+ import { n as ReoptSDKConfig } from "./config-CSUlKyTp.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-Dwf6UuGH.d.ts.map
48
+ //# sourceMappingURL=client-8phVQcw8.d.ts.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-COcHWJzo.js";
1
+ import { t as BaseHttpClient } from "./http-client-CpG8mEHO.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-RnJg4AGr.js.map
83
+ //# sourceMappingURL=client-B9_zWxmn.js.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-BGT9h1OW.js";
1
+ import { n as ReoptSDKConfig } from "./config-CSUlKyTp.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-CJFsLk3_.d.ts.map
24
+ //# sourceMappingURL=client-BY0-0nhP.d.ts.map
@@ -1,7 +1,73 @@
1
- import { S as ReoptSDKError, u as BadRequestError } from "./config-Cxv010M9.js";
2
- import { t as BaseHttpClient } from "./http-client-COcHWJzo.js";
3
- import { t as buildQuery } from "./query-Ch_JZ5Bd.js";
1
+ import { S as ReoptSDKError, u as BadRequestError } from "./config-ChctVyuz.js";
2
+ import { t as BaseHttpClient } from "./http-client-CpG8mEHO.js";
3
+ import { t as buildQuery } from "./query-DFwpKnPG.js";
4
4
 
5
+ //#region src/eav/attribute-keys.ts
6
+ const BUILT_IN_SORT_KEYS = /* @__PURE__ */ new Set(["createdAt", "updatedAt"]);
7
+ function buildAttributeKeyMap(entityName, attributes) {
8
+ return {
9
+ entityName,
10
+ nameToId: new Map(attributes.map((a) => [a.name, a.id])),
11
+ idToName: new Map(attributes.map((a) => [a.id, a.name]))
12
+ };
13
+ }
14
+ /** True when `key` names an attribute of this entity, by name or by ID. */
15
+ function isKnownAttributeKey(map, key) {
16
+ return map.nameToId.has(key) || map.idToName.has(key);
17
+ }
18
+ function toAttributeId(map, key) {
19
+ const byName = map.nameToId.get(key);
20
+ if (byName) return byName;
21
+ if (map.idToName.has(key)) return key;
22
+ throw new BadRequestError(`ReoptSDK: Unknown attribute "${key}" on entity "${map.entityName}". Known attributes: ${[...map.nameToId.keys()].join(", ") || "(none)"}. Run schema sync if the schema changed.`, void 0, "UNKNOWN_ATTRIBUTE");
23
+ }
24
+ function toAttributeIdKeys(map, values) {
25
+ const out = {};
26
+ for (const [key, value] of Object.entries(values)) out[toAttributeId(map, key)] = value;
27
+ return out;
28
+ }
29
+ function toAttributeNameKeys(map, values) {
30
+ const out = {};
31
+ for (const [key, value] of Object.entries(values)) out[map.idToName.get(key) ?? key] = value;
32
+ return out;
33
+ }
34
+ function toNamedRecord(map, record) {
35
+ return {
36
+ ...record,
37
+ values: toAttributeNameKeys(map, record.values ?? {})
38
+ };
39
+ }
40
+ function toIdFilters(map, filters) {
41
+ return filters?.map((f) => ({
42
+ ...f,
43
+ attributeId: toAttributeId(map, f.attributeId)
44
+ }));
45
+ }
46
+ function toIdSortBy(map, sortBy) {
47
+ if (sortBy === void 0 || BUILT_IN_SORT_KEYS.has(sortBy)) return sortBy;
48
+ return toAttributeId(map, sortBy);
49
+ }
50
+ /** Translate every attribute reference in a list/count/backfill query. */
51
+ function toIdQuery(map, query) {
52
+ if (!query) return query;
53
+ const out = { ...query };
54
+ if (query.filters) out.filters = toIdFilters(map, query.filters);
55
+ if (query.sortBy !== void 0) out.sortBy = toIdSortBy(map, query.sortBy);
56
+ if (query.select) out.select = query.select.map((k) => toAttributeId(map, k));
57
+ return out;
58
+ }
59
+ /** Every attribute key a query or write refers to — used to refresh a stale map once. */
60
+ function collectAttributeKeys(input) {
61
+ const keys = [];
62
+ if (input.values) keys.push(...Object.keys(input.values));
63
+ if (input.increments) keys.push(...Object.keys(input.increments));
64
+ if (input.filters) keys.push(...input.filters.map((f) => f.attributeId));
65
+ if (input.sortBy !== void 0 && !BUILT_IN_SORT_KEYS.has(input.sortBy)) keys.push(input.sortBy);
66
+ if (input.select) keys.push(...input.select);
67
+ return keys;
68
+ }
69
+
70
+ //#endregion
5
71
  //#region src/eav/cache.ts
6
72
  var SchemaCache = class {
7
73
  cache = /* @__PURE__ */ new Map();
@@ -517,7 +583,10 @@ function createReoptEavClient(config) {
517
583
  async schemaHash() {
518
584
  return (await http.fetch("GET", "/schema-hash")).data;
519
585
  },
520
- /** Create a type-safe entity-scoped client. Resolves entity name to ID automatically.
586
+ /** Create a type-safe entity-scoped client. Resolves the entity name to its
587
+ * ID and translates attribute **names** to IDs on the way out (values,
588
+ * increments, filters, `sortBy`, `select`) and IDs back to names on the
589
+ * way in — the server only understands attribute IDs.
521
590
  * Requires `schema` in SDK config for type inference.
522
591
  * @example
523
592
  * ```ts
@@ -525,68 +594,136 @@ function createReoptEavClient(config) {
525
594
  * const record = await contacts.records.create({
526
595
  * values: { name: "John", email: "john@example.com" }, // typed!
527
596
  * });
597
+ * record.values.name; // "John"
598
+ * await contacts.records.list({ filters: [where("email").contains("@")] });
528
599
  * ```
529
600
  */
530
601
  entity(name) {
531
602
  const entityName = config.schema ? config.schema.entities[name].name : name;
603
+ /**
604
+ * Resolve the entity and its attribute map. When the call refers to a
605
+ * key the cached map does not know (an attribute added since the cache
606
+ * was filled), refetch the entity once before giving up.
607
+ */
608
+ async function resolve(keys = []) {
609
+ const id = await resolveEntityId(entityName);
610
+ let map = buildAttributeKeyMap(entityName, (await client.entities.get(id)).attributes ?? []);
611
+ if (keys.some((k) => !isKnownAttributeKey(map, k))) {
612
+ schemaCache.invalidate(`entity:${id}`);
613
+ map = buildAttributeKeyMap(entityName, (await client.entities.get(id)).attributes ?? []);
614
+ }
615
+ return {
616
+ id,
617
+ map
618
+ };
619
+ }
620
+ const named = (map, r) => toNamedRecord(map, r);
532
621
  return {
533
622
  entityName,
534
623
  records: {
535
624
  async list(query) {
536
- const id = await resolveEntityId(entityName);
537
- return client.records.list(id, query);
625
+ const { id, map } = await resolve(collectAttributeKeys(query ?? {}));
626
+ const page = await client.records.list(id, toIdQuery(map, query));
627
+ return {
628
+ ...page,
629
+ records: page.records.map((r) => named(map, r))
630
+ };
538
631
  },
539
632
  async findOne(query) {
540
- const id = await resolveEntityId(entityName);
541
- return client.records.findOne(id, query);
633
+ const { id, map } = await resolve(collectAttributeKeys(query ?? {}));
634
+ const r = await client.records.findOne(id, toIdQuery(map, query));
635
+ return r ? named(map, r) : null;
542
636
  },
543
637
  async create(input) {
544
- const id = await resolveEntityId(entityName);
545
- return client.records.create(id, input);
638
+ const values = input.values;
639
+ const { id, map } = await resolve(collectAttributeKeys({ values }));
640
+ const r = await client.records.create(id, {
641
+ ...input,
642
+ values: toAttributeIdKeys(map, values)
643
+ });
644
+ return named(map, r);
546
645
  },
547
646
  async upsert(input) {
548
- const id = await resolveEntityId(entityName);
549
- return client.records.upsert(id, input);
647
+ const values = input.values;
648
+ const { id, map } = await resolve(collectAttributeKeys({
649
+ values,
650
+ filters: input.filters
651
+ }));
652
+ const res = await client.records.upsert(id, {
653
+ ...input,
654
+ filters: toIdFilters(map, input.filters) ?? [],
655
+ values: toAttributeIdKeys(map, values)
656
+ });
657
+ return {
658
+ ...res,
659
+ data: named(map, res.data)
660
+ };
550
661
  },
551
662
  async get(recordId) {
552
- const id = await resolveEntityId(entityName);
553
- return client.records.get(id, recordId);
663
+ const { id, map } = await resolve();
664
+ return named(map, await client.records.get(id, recordId));
554
665
  },
555
666
  async update(recordId, input) {
556
- const id = await resolveEntityId(entityName);
557
- return client.records.update(id, recordId, input);
667
+ const values = input.values;
668
+ const increments = input.increments;
669
+ const { id, map } = await resolve(collectAttributeKeys({
670
+ values,
671
+ increments
672
+ }));
673
+ const body = { ...input };
674
+ if (values) body.values = toAttributeIdKeys(map, values);
675
+ if (increments) body.increments = toAttributeIdKeys(map, increments);
676
+ return named(map, await client.records.update(id, recordId, body));
558
677
  },
559
678
  async delete(recordId) {
560
679
  const id = await resolveEntityId(entityName);
561
680
  return client.records.delete(id, recordId);
562
681
  },
563
682
  async count(query) {
564
- const id = await resolveEntityId(entityName);
565
- return client.records.count(id, query);
683
+ const { id, map } = await resolve(collectAttributeKeys(query ?? {}));
684
+ return client.records.count(id, toIdQuery(map, query));
566
685
  },
567
686
  async bulkCreate(records) {
568
- const id = await resolveEntityId(entityName);
569
- return client.records.bulkCreate(id, records);
687
+ const all = records.map((r) => r.values);
688
+ const { id, map } = await resolve(all.flatMap((values) => collectAttributeKeys({ values })));
689
+ return (await client.records.bulkCreate(id, records.map((r, i) => ({
690
+ ...r,
691
+ values: toAttributeIdKeys(map, all[i])
692
+ })))).map((r) => named(map, r));
570
693
  },
571
694
  async bulkDelete(ids) {
572
695
  const id = await resolveEntityId(entityName);
573
696
  return client.records.bulkDelete(id, ids);
574
697
  },
575
698
  async bulkUpdate(updates) {
576
- const id = await resolveEntityId(entityName);
577
- return client.records.bulkUpdate(id, updates);
699
+ const all = updates.map((u) => u.values);
700
+ const { id, map } = await resolve(all.flatMap((values) => collectAttributeKeys({ values })));
701
+ return (await client.records.bulkUpdate(id, updates.map((u, i) => ({
702
+ id: u.id,
703
+ values: toAttributeIdKeys(map, all[i])
704
+ })))).map((r) => named(map, r));
578
705
  },
579
706
  async deleteWhere(input) {
580
- const id = await resolveEntityId(entityName);
581
- return client.records.deleteWhere(id, input);
707
+ const { id, map } = await resolve(collectAttributeKeys({ filters: input.filters }));
708
+ return client.records.deleteWhere(id, {
709
+ ...input,
710
+ filters: toIdFilters(map, input.filters) ?? []
711
+ });
582
712
  },
583
713
  async *listAll(query) {
584
- const id = await resolveEntityId(entityName);
585
- yield* client.records.listAll(id, query);
714
+ const { id, map } = await resolve(collectAttributeKeys(query ?? {}));
715
+ for await (const r of client.records.listAll(id, toIdQuery(map, query))) yield named(map, r);
586
716
  },
587
717
  async backfill(opts) {
588
- const id = await resolveEntityId(entityName);
589
- return client.records.backfill(id, opts);
718
+ const { id, map } = await resolve(collectAttributeKeys(opts));
719
+ const query = toIdQuery(map, opts) ?? opts;
720
+ return client.records.backfill(id, {
721
+ ...query,
722
+ transform: (record) => {
723
+ const next = opts.transform(named(map, record));
724
+ return next === null || next === void 0 ? next : toAttributeIdKeys(map, next);
725
+ }
726
+ });
590
727
  }
591
728
  }
592
729
  };
@@ -603,4 +740,4 @@ function createReoptEavClient(config) {
603
740
 
604
741
  //#endregion
605
742
  export { RECORDS_PAGE_LIMIT_MAX as i, ATTRIBUTE_FILTER_LIST_MAX as n, ATTRIBUTE_FILTER_OPERATORS as r, createReoptEavClient as t };
606
- //# sourceMappingURL=client-BF94tdhy.js.map
743
+ //# sourceMappingURL=client-BjX5K-Qh.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-COcHWJzo.js";
1
+ import { t as BaseHttpClient } from "./http-client-CpG8mEHO.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-v7ed6KdC.js.map
28
+ //# sourceMappingURL=client-BlHPiBEo.js.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-BGT9h1OW.js";
1
+ import { n as ReoptSDKConfig } from "./config-CSUlKyTp.js";
2
2
  //#region src/plans/types.d.ts
3
3
  /**
4
4
  * Brandapp Plans types.
@@ -289,4 +289,4 @@ declare class ReoptPlansClient {
289
289
  declare function createReoptPlansClient(config: ReoptSDKConfig): ReoptPlansClient;
290
290
  //#endregion
291
291
  export { CheckoutStatus as a, MeterPricingMode as c, PlanInterval as d, PlanMeter as f, PlanRequiredTerms as h, CheckoutSession as i, Plan as l, PlanPaymentEnvironment as m, createReoptPlansClient as n, CreateCheckoutInput as o, PlanMeterTier as p, CancelSubscriptionResult as r, CurrentPlan as s, ReoptPlansClient as t, PlanBillingModel as u };
292
- //# sourceMappingURL=client-CD6uK0dA.d.ts.map
292
+ //# sourceMappingURL=client-BrYt--zm.d.ts.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-BGT9h1OW.js";
1
+ import { n as ReoptSDKConfig } from "./config-CSUlKyTp.js";
2
2
  //#region src/feedback/types.d.ts
3
3
  /**
4
4
  * Feedback processing status. `responded` means staff have answered but the
@@ -146,4 +146,4 @@ declare class ReoptFeedbackClient {
146
146
  declare function createReoptFeedbackClient(config: ReoptSDKConfig): ReoptFeedbackClient;
147
147
  //#endregion
148
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 };
149
- //# sourceMappingURL=client-DF-tOyrY.d.ts.map
149
+ //# sourceMappingURL=client-C08BvY3B.d.ts.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-BGT9h1OW.js";
1
+ import { n as ReoptSDKConfig } from "./config-CSUlKyTp.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-NUhpPkl2.d.ts.map
53
+ //# sourceMappingURL=client-C2Yhtnhs.d.ts.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-BGT9h1OW.js";
1
+ import { n as ReoptSDKConfig } from "./config-CSUlKyTp.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-wNzcgEJu.d.ts.map
272
+ //# sourceMappingURL=client-CTNoB_vH.d.ts.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-BGT9h1OW.js";
1
+ import { n as ReoptSDKConfig } from "./config-CSUlKyTp.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-BL-Ljwki.d.ts.map
71
+ //# sourceMappingURL=client-CUdewN3W.d.ts.map
@@ -1,4 +1,4 @@
1
- import { a as resolveIdBaseUrl } from "./config-Cxv010M9.js";
1
+ import { a as resolveIdBaseUrl } from "./config-ChctVyuz.js";
2
2
  import { o as readClientKeyRing, s as toPublicJwk } from "./keys-B_R_lsyF.js";
3
3
  import { createPrivateKeyJwtClientAssertionGetter } from "@better-auth/core/oauth2";
4
4
  import * as jose from "jose";
@@ -191,4 +191,4 @@ function createMachineClient(config) {
191
191
 
192
192
  //#endregion
193
193
  export { createDpopProof as n, createMachineClient as r, MachineTokenError as t };
194
- //# sourceMappingURL=client-CDeaH7JC.js.map
194
+ //# sourceMappingURL=client-Ce3RqyOI.js.map
@@ -1,6 +1,6 @@
1
- import { S as ReoptSDKError, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig } from "./config-Cxv010M9.js";
1
+ import { S as ReoptSDKError, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig } from "./config-ChctVyuz.js";
2
2
  import { t as createManagedAbort } from "./abort--nOBFN4M.js";
3
- import { n as parseFieldErrors, t as BaseHttpClient } from "./http-client-COcHWJzo.js";
3
+ import { n as parseFieldErrors, t as BaseHttpClient } from "./http-client-CpG8mEHO.js";
4
4
 
5
5
  //#region src/files/client.ts
6
6
  var ReoptFileClient = class {
@@ -276,4 +276,4 @@ function createReoptFileClient(config) {
276
276
 
277
277
  //#endregion
278
278
  export { createReoptFileClient as n, ReoptFileClient as t };
279
- //# sourceMappingURL=client-Do7Eny_J.js.map
279
+ //# sourceMappingURL=client-DCd3T29e.js.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-BGT9h1OW.js";
1
+ import { n as ReoptSDKConfig } from "./config-CSUlKyTp.js";
2
2
  //#region src/ai/types.d.ts
3
3
  /** 메시지 역할 */
4
4
  type MessageRole = "system" | "user" | "assistant";
@@ -407,4 +407,4 @@ declare class ReoptAiClient {
407
407
  declare function createReoptAiClient(config: ReoptSDKConfig): ReoptAiClient;
408
408
  //#endregion
409
409
  export { StreamEvent as C, StreamDoneData as S, ImageGenerateOptions as _, CompletionContentPart as a, ModelInfo as b, CompletionUsage as c, EvaluateOptions as d, EvaluationAnswer as f, FinishReason as g, EvaluationResult as h, ChatMessage as i, CompletionWarning as l, EvaluationQuestion as m, createReoptAiClient as n, CompletionOptions as o, EvaluationInput as p, AgentInfo as r, CompletionResult as s, ReoptAiClient as t, CreditInfo as u, ImageGenerateResult as v, PartProviderMetadata as x, MessageRole as y };
410
- //# sourceMappingURL=client-CP1Jgq4R.d.ts.map
410
+ //# sourceMappingURL=client-DD9y7Qew.d.ts.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-COcHWJzo.js";
1
+ import { t as BaseHttpClient } from "./http-client-CpG8mEHO.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-CoaQxuaG.js.map
86
+ //# sourceMappingURL=client-DIAWwOhv.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-COcHWJzo.js";
1
+ import { t as BaseHttpClient } from "./http-client-CpG8mEHO.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-DoK8YCd_.js.map
20
+ //# sourceMappingURL=client-DbbbBNJm.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-COcHWJzo.js";
1
+ import { t as BaseHttpClient } from "./http-client-CpG8mEHO.js";
2
2
 
3
3
  //#region src/plans/client.ts
4
4
  function unwrap(body) {
@@ -143,4 +143,4 @@ function createReoptPlansClient(config) {
143
143
 
144
144
  //#endregion
145
145
  export { createReoptPlansClient as n, ReoptPlansClient as t };
146
- //# sourceMappingURL=client-BvgSoqAc.js.map
146
+ //# sourceMappingURL=client-Dg-hO_LG.js.map