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

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 (50) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/ai/index.js +2 -2
  3. package/dist/ai-provider/index.js +1 -1
  4. package/dist/analytics/index.js +1 -1
  5. package/dist/auth/index.js +1 -1
  6. package/dist/better-auth/index.js +2 -2
  7. package/dist/{client-BBfRO86C.js → client-BAr_BNfz.js} +3 -3
  8. package/dist/{client-BvgSoqAc.js → client-BBx2uOT6.js} +2 -2
  9. package/dist/{client-Ca_5meV_.js → client-BH7PYWbE.js} +2 -2
  10. package/dist/{client-B2nwOzdZ.js → client-BLmIi1fg.js} +3 -3
  11. package/dist/{client-DoK8YCd_.js → client-CU_ot3SS.js} +2 -2
  12. package/dist/{client-v7ed6KdC.js → client-Ce0z7WTl.js} +2 -2
  13. package/dist/{client-RnJg4AGr.js → client-CwfUFDWS.js} +2 -2
  14. package/dist/{client-CJRjPSf7.d.ts → client-CyFOwE5p.d.ts} +25 -6
  15. package/dist/{client-D38XGQRR.js → client-DHmwj3qm.js} +4 -4
  16. package/dist/{client-Do7Eny_J.js → client-Dn5CjA4d.js} +3 -3
  17. package/dist/{client-CoaQxuaG.js → client-OEX6i4XJ.js} +2 -2
  18. package/dist/{client-CDeaH7JC.js → client-OHAVqTBu.js} +2 -2
  19. package/dist/{client-BF94tdhy.js → client-loa5Z9hY.js} +166 -29
  20. package/dist/cms/index.js +1 -1
  21. package/dist/{config-Cxv010M9.js → config-DrtdQNzj.js} +2 -2
  22. package/dist/dev/index.js +49 -10
  23. package/dist/eav/index.d.ts +1 -1
  24. package/dist/eav/index.js +2 -2
  25. package/dist/eav/migrate.d.ts +1 -1
  26. package/dist/eav/schema.d.ts +1 -1
  27. package/dist/eav/schema.js +1 -1
  28. package/dist/feedback/index.js +1 -1
  29. package/dist/files/index.d.ts +11 -0
  30. package/dist/files/index.js +14 -1
  31. package/dist/{http-client-COcHWJzo.js → http-client-DQf8pVNw.js} +2 -2
  32. package/dist/{index-CaXrNTtU.d.ts → index-BQaGBa_K.d.ts} +2 -2
  33. package/dist/index.d.ts +2 -2
  34. package/dist/index.js +12 -12
  35. package/dist/installation/index.js +3 -3
  36. package/dist/logout/index.js +1 -1
  37. package/dist/machine/index.js +1 -1
  38. package/dist/plans/index.js +1 -1
  39. package/dist/push/index.js +1 -1
  40. package/dist/{query-Ch_JZ5Bd.js → query-ktdIV5kz.js} +2 -2
  41. package/dist/react/hooks.d.ts +1 -1
  42. package/dist/social/index.js +1 -1
  43. package/dist/terms/index.js +1 -1
  44. package/dist/testing/index.d.ts +1 -1
  45. package/dist/workspace/index.js +1 -1
  46. package/docs/api-reference.md +2 -1
  47. package/docs/dev-server.md +6 -1
  48. package/docs/files.md +6 -1
  49. package/docs/testing.md +4 -4
  50. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,37 @@ This project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [4.7.0-rc.14] — 2026-11-20
11
+
12
+ Pre-release (`npm i @reopt-ai/brandapp-sdk@next`) — 타입 EAV 클라이언트(`sdk.eav.entity(name)`)가 실서버에서
13
+ 쓰기를 조용히 잃던 결함을 고친다. 🔴 rc.13 이하에서 `entity()`로 값을 썼다면 실서버에는 아무것도 저장되지 않았다
14
+ (아래 Fixed 첫 항목).
15
+
16
+ ### Fixed
17
+
18
+ - **`sdk.eav.entity(name)`가 속성 이름을 속성 ID로 바꿔 보낸다.** 서버는 레코드 값·필터·`sortBy`·`select`를 속성
19
+ ID로만 읽고 모르는 키는 말없이 버린다. 그런데 타입 클라이언트는 이름 키(`values: { title }`)를 그대로 보냈다 —
20
+ 생성은 필수값 누락 422, 조회 결과는 ID 키라 `record.values.title`이 `undefined`, **수정은 200을 돌려주고 아무것도
21
+ 바꾸지 않았다**. 이제 `values`·`increments`·`filters[].attributeId`(`where("name")` 포함)·`sortBy`·`select`를
22
+ 이름 → ID로 바꿔 보내고, 응답 레코드의 `values`를 ID → 이름으로 돌려준다(`backfill`의 `transform`도 이름 키로
23
+ 받고 이름 키로 돌려준다). 속성 ID를 키로 넘겨도 그대로 통한다(우회해 둔 코드가 깨지지 않는다).
24
+ 모르는 키는 서버에 보내기 전에 `UNKNOWN_ATTRIBUTE`(`BadRequestError`)로 거절한다 — 스키마가 바뀐 직후일 수 있어
25
+ 엔티티를 한 번 다시 읽은 뒤에 판정한다. 엔티티 속성 목록은 엔티티 이름 캐시와 함께 5분 캐시된다.
26
+ ⚠️ 응답의 `values`가 이름 키가 됐다 — rc.13에서 `entity()` 결과를 `values[attributeId]`로 읽어 우회했다면
27
+ `values.<이름>`으로 바꾼다. ID 키 원시 API(`sdk.eav.records.*`)는 바뀌지 않았다.
28
+ - **dev 서버가 속성 ID를 실서버처럼 따로 발급한다.** 지금까지는 속성 이름을 ID로 써서 위 결함이 로컬에서
29
+ 드러나지 않았고, 한 전역 맵에 넣어 서로 다른 엔티티의 같은 이름 속성(예: 두 엔티티의 `title`)이 마지막 것으로
30
+ 덮였다. 레코드 값도 실서버처럼 그 엔티티의 속성 ID가 아닌 키를 버린다. `dev.seed()`·`seedAll`은 종전대로 이름
31
+ 키를 받는다(ID로 바꿔 저장). ⚠️ dev 서버에 원시 HTTP·ID 키 API로 이름 키를 보내던 테스트는 실서버와 같이
32
+ 값이 버려진다 — `entity()`를 쓰거나 `GET /entities/:id`의 속성 ID로 바꾼다.
33
+ - **`eav sync`가 선언하지 않은 `icon`을 변경으로 보지 않는다.** 서버는 icon 없이 만든 엔티티에 기본값(📊)을
34
+ 넣는데, diff가 "미선언 = null"로 읽어 매 dry-run마다 `icon: null` 갱신을 내놓았다. 이제 `defineEntity`에
35
+ `icon`을 적었을 때만 맞춘다(서버의 icon을 지우려면 다른 값을 선언한다).
36
+ - **`REOPT_IMAGE_REMOTE_PATTERNS`에 실제 파일 호스트를 넣었다** — `sdk.files`가 돌려주는 `url`은
37
+ `https://studio.reopt.ai/api/blob/...`(리옵트 서빙 프록시)인데 목록에는 Vercel Blob 호스트만 있어 `next/image`가
38
+ 거절했다. `ImageRemotePattern`에 `pathname`이 생겼다. 로컬(`studio.local.reopt.io`)은 루프백이라 Next.js가
39
+ 패턴과 무관하게 거절한다 — `docs/files.md` 참고.
40
+
10
41
  ## [4.7.0-rc.13] — 2026-11-08
11
42
 
12
43
  Pre-release (`npm i @reopt-ai/brandapp-sdk@next`) — 앱 심사용 번호를 리옵트 콘솔로 옮기고, 전화번호 정본을 E.164로
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-DrtdQNzj.js";
2
+ import { n as createReoptAiClient, t as ReoptAiClient } from "../client-DHmwj3qm.js";
3
3
 
4
4
  //#region src/ai/evaluator.ts
5
5
  function createBrandappEvaluator(source, options = {}) {
@@ -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-DrtdQNzj.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, t as ReoptAnalyticsClient } from "../client-DoK8YCd_.js";
1
+ import { n as createReoptAnalyticsClient, t as ReoptAnalyticsClient } from "../client-CU_ot3SS.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 { n as createReoptAuthClient, t as ReoptAuthClient } from "../client-Ca_5meV_.js";
1
+ import { n as createReoptAuthClient, t as ReoptAuthClient } from "../client-BH7PYWbE.js";
2
2
 
3
3
  //#region src/auth/session.ts
4
4
  /**
@@ -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-DrtdQNzj.js";
2
+ import { t as BaseHttpClient } from "../http-client-DQf8pVNw.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,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-DQf8pVNw.js";
2
+ import { t as buildQuery } from "./query-ktdIV5kz.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-BAr_BNfz.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-COcHWJzo.js";
1
+ import { t as BaseHttpClient } from "./http-client-DQf8pVNw.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-BBx2uOT6.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-COcHWJzo.js";
1
+ import { t as BaseHttpClient } from "./http-client-DQf8pVNw.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-Ca_5meV_.js.map
53
+ //# sourceMappingURL=client-BH7PYWbE.js.map
@@ -1,6 +1,6 @@
1
- import { n as SDK_VERSION } from "./config-Cxv010M9.js";
1
+ import { n as SDK_VERSION } from "./config-DrtdQNzj.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-OHAVqTBu.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-BLmIi1fg.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-COcHWJzo.js";
1
+ import { t as BaseHttpClient } from "./http-client-DQf8pVNw.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-CU_ot3SS.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-COcHWJzo.js";
1
+ import { t as BaseHttpClient } from "./http-client-DQf8pVNw.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-Ce0z7WTl.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-COcHWJzo.js";
1
+ import { t as BaseHttpClient } from "./http-client-DQf8pVNw.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-CwfUFDWS.js.map
@@ -4,7 +4,15 @@ import { A as ListRecordsQuery, C as EavAttribute, D as EavRecord, E as EavEntit
4
4
  type TypedEavRecord<V> = Omit<EavRecord, "values"> & {
5
5
  values: V;
6
6
  };
7
- /** Entity-scoped client with typed records API */
7
+ /**
8
+ * Entity-scoped client with typed records API.
9
+ *
10
+ * Every attribute reference — `values`, `increments`, `filters[].attributeId`,
11
+ * `sortBy`, `select` — is written by **attribute name** (an attribute ID is
12
+ * also accepted), and returned records carry name-keyed `values`. The client
13
+ * translates to the server's attribute IDs and rejects unknown keys with
14
+ * `UNKNOWN_ATTRIBUTE` instead of letting the server drop them.
15
+ */
8
16
  type EntityClient<E extends EntityDef> = {
9
17
  readonly entityName: string;
10
18
  records: {
@@ -13,6 +21,8 @@ type EntityClient<E extends EntityDef> = {
13
21
  create(input: {
14
22
  authUserId?: string;
15
23
  values: InferValues<E>;
24
+ /** ISO 8601 TTL. brandapp free tables only. */
25
+ expiresAt?: string;
16
26
  }): Promise<TypedEavRecord<InferValues<E>>>;
17
27
  upsert(input: {
18
28
  authUserId?: string;
@@ -20,20 +30,29 @@ type EntityClient<E extends EntityDef> = {
20
30
  values: InferValues<E>;
21
31
  }): Promise<UpsertRecordResult<TypedEavRecord<InferValues<E>>>>;
22
32
  get(recordId: string): Promise<TypedEavRecord<InferValues<E>>>;
23
- update(recordId: string, input: {
24
- values: Partial<InferValues<E>>;
33
+ update(recordId: string, input: Omit<UpdateRecordInput, "values" | "increments"> & {
34
+ values?: Partial<InferValues<E>>;
35
+ /** Atomic number deltas keyed by attribute name. */
36
+ increments?: Partial<Record<keyof InferValues<E> & string, number>>;
25
37
  }): Promise<TypedEavRecord<InferValues<E>>>;
26
38
  delete(recordId: string): Promise<void>;
27
39
  count(query?: CountRecordsQuery): Promise<number>;
28
40
  bulkCreate(records: Array<{
29
41
  authUserId?: string;
30
42
  values: InferValues<E>;
43
+ expiresAt?: string;
31
44
  }>): Promise<TypedEavRecord<InferValues<E>>[]>;
32
45
  bulkDelete(ids: string[]): Promise<number>;
33
- bulkUpdate(updates: BulkUpdateItem[]): Promise<TypedEavRecord<InferValues<E>>[]>;
46
+ bulkUpdate(updates: Array<{
47
+ id: string;
48
+ values: Partial<InferValues<E>>;
49
+ }>): Promise<TypedEavRecord<InferValues<E>>[]>;
34
50
  deleteWhere(input: DeleteWhereInput): Promise<number>;
35
51
  listAll(query?: Omit<ListRecordsQuery, "page">): AsyncGenerator<TypedEavRecord<InferValues<E>>>;
36
- backfill(opts: BackfillOptions): Promise<BackfillResult>;
52
+ /** `transform` receives the record with name-keyed values and returns name-keyed values. */
53
+ backfill(opts: Omit<BackfillOptions, "transform"> & {
54
+ transform: (record: TypedEavRecord<InferValues<E>>) => Partial<InferValues<E>> | null | undefined;
55
+ }): Promise<BackfillResult>;
37
56
  };
38
57
  };
39
58
  //#endregion
@@ -100,4 +119,4 @@ type ReoptEavClient<S extends SchemaDef = SchemaDef> = {
100
119
  declare function createReoptEavClient<S extends SchemaDef = SchemaDef>(config: ReoptSDKConfig<S>): ReoptEavClient<S>;
101
120
  //#endregion
102
121
  export { TypedEavRecord as i, createReoptEavClient as n, EntityClient as r, ReoptEavClient as t };
103
- //# sourceMappingURL=client-CJRjPSf7.d.ts.map
122
+ //# sourceMappingURL=client-CyFOwE5p.d.ts.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-DrtdQNzj.js";
2
2
  import { t as createManagedAbort } from "./abort--nOBFN4M.js";
3
- import { t as BaseHttpClient } from "./http-client-COcHWJzo.js";
3
+ import { t as BaseHttpClient } from "./http-client-DQf8pVNw.js";
4
4
  import { n as parseSSEStream } from "./sse-parser-D65dmL4A.js";
5
5
 
6
6
  //#region src/ai/client.ts
@@ -262,7 +262,7 @@ var ReoptAiClient = class {
262
262
  }
263
263
  async fetchSSE(options) {
264
264
  const url = `${this.http.requestBaseUrl}/chat/completions`;
265
- const requestId = globalThis.crypto?.randomUUID?.() ?? `sdk-${"4.7.0-rc.13"}-${url.length}`;
265
+ const requestId = globalThis.crypto?.randomUUID?.() ?? `sdk-${"4.7.0-rc.14"}-${url.length}`;
266
266
  const ctx = {
267
267
  method: "POST",
268
268
  url,
@@ -343,4 +343,4 @@ function createReoptAiClient(config) {
343
343
 
344
344
  //#endregion
345
345
  export { createReoptAiClient as n, ReoptAiClient as t };
346
- //# sourceMappingURL=client-D38XGQRR.js.map
346
+ //# sourceMappingURL=client-DHmwj3qm.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-DrtdQNzj.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-DQf8pVNw.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-Dn5CjA4d.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-COcHWJzo.js";
1
+ import { t as BaseHttpClient } from "./http-client-DQf8pVNw.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-OEX6i4XJ.js.map
@@ -1,4 +1,4 @@
1
- import { a as resolveIdBaseUrl } from "./config-Cxv010M9.js";
1
+ import { a as resolveIdBaseUrl } from "./config-DrtdQNzj.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-OHAVqTBu.js.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-DrtdQNzj.js";
2
+ import { t as BaseHttpClient } from "./http-client-DQf8pVNw.js";
3
+ import { t as buildQuery } from "./query-ktdIV5kz.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-loa5Z9hY.js.map
package/dist/cms/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as createReoptCmsClient } from "../client-BBfRO86C.js";
1
+ import { t as createReoptCmsClient } from "../client-BAr_BNfz.js";
2
2
 
3
3
  //#region src/cms/helpers.ts
4
4
  function joinUrl(siteUrl, path) {
@@ -370,7 +370,7 @@ function mapHttpStatusToError(status, code, message, ctx, fieldErrors) {
370
370
 
371
371
  //#endregion
372
372
  //#region src/core/config.ts
373
- const SDK_VERSION = "4.7.0-rc.13";
373
+ const SDK_VERSION = "4.7.0-rc.14";
374
374
  /**
375
375
  * Default API host for EAV / AI / Files / CMS / Terms. Consumers can override
376
376
  * via `config.baseUrl` or the `REOPT_BASE_URL` env var.
@@ -552,4 +552,4 @@ function deriveIdFromBaseUrl(baseUrl) {
552
552
 
553
553
  //#endregion
554
554
  export { isValidationError as A, RequiredTermsError as C, isModelAccessError as D, isCreditLimitError as E, isReoptSDKError as O, ReoptSDKError as S, ValidationError as T, ModelAccessError as _, resolveIdBaseUrl as a, PreconditionFailedError as b, AuthUserNotFoundError as c, ConflictError as d, ContentFilterError as f, LimitExceededError as g, ForbiddenError as h, resolveBaseUrl as i, mapHttpStatusToError as j, isRequiredTermsError as k, AuthUserRecordExistsError as l, DuplicateAuthUserError as m, SDK_VERSION as n, validateConfig as o, CreditLimitError as p, assertBrowserSafe as r, AuthError as s, REOPT_BASE_URLS as t, BadRequestError as u, ModelNotFoundError as v, ServerError as w, RateLimitError as x, NotFoundError as y };
555
- //# sourceMappingURL=config-Cxv010M9.js.map
555
+ //# sourceMappingURL=config-DrtdQNzj.js.map
package/dist/dev/index.js CHANGED
@@ -305,6 +305,18 @@ function validateRequiredFields(values, attributes) {
305
305
  }
306
306
  return errors;
307
307
  }
308
+ /**
309
+ * Production mirror: the server sanitizes record values against the entity's
310
+ * fields and **drops every key that is not one of its attribute IDs**
311
+ * (`validateEavRecordValues` → `sanitized`). Keep the mock as strict — when it
312
+ * stored unknown keys, a client sending attribute *names* worked locally and
313
+ * silently lost every write in production.
314
+ */
315
+ function pickKnownAttributeValues(store, entityId, values) {
316
+ if (!values) return {};
317
+ const known = new Set(store.getAttributesByEntity(entityId).map((a) => a.id));
318
+ return Object.fromEntries(Object.entries(values).filter(([key]) => known.has(key)));
319
+ }
308
320
  function validationErrorResponse(fields) {
309
321
  return {
310
322
  ok: false,
@@ -744,8 +756,9 @@ function createEavRoutes(store, brandappId) {
744
756
  }
745
757
  }, 404);
746
758
  const body = await c.req.json();
759
+ body.values = pickKnownAttributeValues(store, entityId, body.values);
747
760
  const attrs = store.getAttributesByEntity(entityId);
748
- const missing = validateRequiredFields(body.values ?? {}, attrs);
761
+ const missing = validateRequiredFields(body.values, attrs);
749
762
  if (missing.length > 0) return c.json(validationErrorResponse(missing), 422);
750
763
  const isAuthUserLinked = entity.linkedTo === "brandappAuthUser";
751
764
  if (isAuthUserLinked) {
@@ -776,7 +789,7 @@ function createEavRoutes(store, brandappId) {
776
789
  updatedAt: now,
777
790
  version: 1,
778
791
  expiresAt: body.expiresAt ? new Date(body.expiresAt) : null,
779
- values: Object.entries(body.values).map(([attributeId, value]) => ({
792
+ values: Object.entries(pickKnownAttributeValues(store, entityId, body.values)).map(([attributeId, value]) => ({
780
793
  recordId: "",
781
794
  attributeId,
782
795
  value: typeof value === "string" ? value : JSON.stringify(value)
@@ -833,7 +846,7 @@ function createEavRoutes(store, brandappId) {
833
846
  }
834
847
  }, 404);
835
848
  const body = await c.req.json();
836
- const values = body.values ?? {};
849
+ const values = pickKnownAttributeValues(store, entityId, body.values);
837
850
  const increments = body.increments ?? {};
838
851
  const attrsById = new Map(store.getAttributesByEntity(entityId).map((a) => [a.id, a]));
839
852
  const incrementErrors = [];
@@ -986,7 +999,7 @@ function createEavRoutes(store, brandappId) {
986
999
  updatedAt: now,
987
1000
  version: 1,
988
1001
  expiresAt: null,
989
- values: Object.entries(r.values).map(([attributeId, value]) => ({
1002
+ values: Object.entries(pickKnownAttributeValues(store, entityId, r.values)).map(([attributeId, value]) => ({
990
1003
  recordId: "",
991
1004
  attributeId,
992
1005
  value: typeof value === "string" ? value : JSON.stringify(value)
@@ -1023,7 +1036,7 @@ function createEavRoutes(store, brandappId) {
1023
1036
  message: "Some records not found"
1024
1037
  }
1025
1038
  }, 400);
1026
- for (const [attributeId, value] of Object.entries(u.values)) {
1039
+ for (const [attributeId, value] of Object.entries(pickKnownAttributeValues(store, entityId, u.values))) {
1027
1040
  const serialized = typeof value === "string" ? value : JSON.stringify(value);
1028
1041
  const existing = record.values.find((v) => v.attributeId === attributeId);
1029
1042
  if (existing) existing.value = serialized;
@@ -1099,7 +1112,7 @@ function createEavRoutes(store, brandappId) {
1099
1112
  if (body.authUserId) candidates = candidates.filter((r) => r.brandappAuthUserId === body.authUserId);
1100
1113
  const matched = isAuthUserLinked ? candidates[0] : filterRecords(candidates, body.filters)[0];
1101
1114
  if (matched) {
1102
- for (const [attributeId, value] of Object.entries(body.values)) {
1115
+ for (const [attributeId, value] of Object.entries(pickKnownAttributeValues(store, entityId, body.values))) {
1103
1116
  const serialized = typeof value === "string" ? value : JSON.stringify(value);
1104
1117
  const existing = matched.values.find((v) => v.attributeId === attributeId);
1105
1118
  if (existing) existing.value = serialized;
@@ -1138,7 +1151,7 @@ function createEavRoutes(store, brandappId) {
1138
1151
  updatedAt: now,
1139
1152
  version: 1,
1140
1153
  expiresAt: null,
1141
- values: Object.entries(body.values).map(([attributeId, value]) => ({
1154
+ values: Object.entries(pickKnownAttributeValues(store, entityId, body.values)).map(([attributeId, value]) => ({
1142
1155
  recordId: "",
1143
1156
  attributeId,
1144
1157
  value: typeof value === "string" ? value : JSON.stringify(value)
@@ -2830,7 +2843,7 @@ function seedSchema(store, brandappId, schema) {
2830
2843
  });
2831
2844
  let sortOrder = 0;
2832
2845
  for (const [attrKey, attrDef] of Object.entries(entityDef.attributes)) {
2833
- const attrId = attrKey;
2846
+ const attrId = store.generateId();
2834
2847
  store.attributes.set(attrId, {
2835
2848
  id: attrId,
2836
2849
  entityId,
@@ -2881,6 +2894,30 @@ function findSeedRecordByKeys(store, entity, input, keys) {
2881
2894
  return keys.every((key) => existingValues[key] === toSeedValue(input.values[key]));
2882
2895
  }) ?? null;
2883
2896
  }
2897
+ /**
2898
+ * Seed input is written by attribute name (as the typed client is). Translate
2899
+ * names to this entity's attribute IDs; an ID or an unknown key passes through
2900
+ * unchanged so persisted pre-4.7.0-rc.14 data (name-as-ID) still matches.
2901
+ */
2902
+ function toSeedRecordWithIds(store, entity, input) {
2903
+ const nameToId = new Map([...store.attributes.values()].filter((attr) => attr.entityId === entity.id).map((attr) => [attr.name, attr.id]));
2904
+ const toId = (key) => nameToId.get(key) ?? key;
2905
+ const keys = normalizeUpsertKey(input.upsertKey);
2906
+ return {
2907
+ ...input,
2908
+ values: Object.fromEntries(Object.entries(input.values).map(([key, value]) => [toId(key), value])),
2909
+ ...keys.length > 0 ? { upsertKey: keys.map(toId) } : {}
2910
+ };
2911
+ }
2912
+ function toSeedOptionsWithIds(store, entity, options) {
2913
+ const keys = normalizeUpsertKey(options?.upsertKey);
2914
+ if (!options || keys.length === 0) return options;
2915
+ const nameToId = new Map([...store.attributes.values()].filter((attr) => attr.entityId === entity.id).map((attr) => [attr.name, attr.id]));
2916
+ return {
2917
+ ...options,
2918
+ upsertKey: keys.map((k) => nameToId.get(k) ?? k)
2919
+ };
2920
+ }
2884
2921
  function buildSeedValues(recordId, values) {
2885
2922
  return Object.entries(values).map(([key, value]) => ({
2886
2923
  recordId,
@@ -3229,9 +3266,11 @@ async function createDevServer(options = {}) {
3229
3266
  console.warn(`[reopt-dev] Entity "${entityName}" not found. Available: ${[...store.entities.values()].map((e) => e.name).join(", ")}`);
3230
3267
  continue;
3231
3268
  }
3232
- for (const r of records) {
3269
+ const entityOptions = toSeedOptionsWithIds(store, entity, options);
3270
+ for (const raw of records) {
3271
+ const r = toSeedRecordWithIds(store, entity, raw);
3233
3272
  const now = store.now();
3234
- const upsertKeys = options?.mode === "upsert" ? getSeedUpsertKeys(store, entity, r, options) : [];
3273
+ const upsertKeys = options?.mode === "upsert" ? getSeedUpsertKeys(store, entity, r, entityOptions) : [];
3235
3274
  const existing = options?.mode === "upsert" ? findSeedRecordByKeys(store, entity, r, upsertKeys) : null;
3236
3275
  if (existing) {
3237
3276
  const nextValues = buildSeedValues(existing.id, r.values);
@@ -1,6 +1,6 @@
1
1
  import { A as ListRecordsQuery, C as EavAttribute, D as EavRecord, E as EavEntity, F as UpdateRecordInput, I as UpsertRecordInput, L as UpsertRecordResult, M as RECORDS_PAGE_LIMIT_MAX, N as UpdateAttributeInput, O as EavSchemaLinkedTo, P as UpdateEntityInput, S as DeleteWhereInput, T as EavDataType, _ as BulkUpdateItem, b as CreateEntityInput, d as ATTRIBUTE_FILTER_OPERATORS, f as AttributeFilter, j as PaginatedResponse, k as EavValidation, m as AttributeFilterOperator, n as ReoptSDKConfig, p as AttributeFilterListValue, u as ATTRIBUTE_FILTER_LIST_MAX, v as CountRecordsQuery, w as EavAttributeOption, x as CreateRecordInput, y as CreateAttributeInput } from "../config-BGT9h1OW.js";
2
2
  import { c as DuplicateAuthUserError, f as LimitExceededError, n as AuthUserNotFoundError, r as AuthUserRecordExistsError } from "../errors-D-Va8oeC.js";
3
- import { i as TypedEavRecord, n as createReoptEavClient, r as EntityClient, t as ReoptEavClient } from "../client-CJRjPSf7.js";
3
+ import { i as TypedEavRecord, n as createReoptEavClient, r as EntityClient, t as ReoptEavClient } from "../client-CyFOwE5p.js";
4
4
  //#region src/eav/verify.d.ts
5
5
  /**
6
6
  * Runtime drift check between a deployed bundle and the live server schema
package/dist/eav/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { c as AuthUserNotFoundError, g as LimitExceededError, l as AuthUserRecordExistsError, m as DuplicateAuthUserError } from "../config-Cxv010M9.js";
2
- import { i as RECORDS_PAGE_LIMIT_MAX, n as ATTRIBUTE_FILTER_LIST_MAX, r as ATTRIBUTE_FILTER_OPERATORS, t as createReoptEavClient } from "../client-BF94tdhy.js";
1
+ import { c as AuthUserNotFoundError, g as LimitExceededError, l as AuthUserRecordExistsError, m as DuplicateAuthUserError } from "../config-DrtdQNzj.js";
2
+ import { i as RECORDS_PAGE_LIMIT_MAX, n as ATTRIBUTE_FILTER_LIST_MAX, r as ATTRIBUTE_FILTER_OPERATORS, t as createReoptEavClient } from "../client-loa5Z9hY.js";
3
3
 
4
4
  //#region src/eav/verify.ts
5
5
  async function verifyEavSchema(input) {
@@ -1,5 +1,5 @@
1
1
  import { o as AttributeDef, s as EntityDef } from "../config-BGT9h1OW.js";
2
- import { t as ReoptEavClient } from "../client-CJRjPSf7.js";
2
+ import { t as ReoptEavClient } from "../client-CyFOwE5p.js";
3
3
  //#region src/eav/migrate/types.d.ts
4
4
  /**
5
5
  * Subset of `ReoptEavClient.records` exposed inside a migration's `up`/`down`.
@@ -1,5 +1,5 @@
1
1
  import { C as EavAttribute, E as EavEntity, T as EavDataType, c as InferValues, l as SchemaDef, o as AttributeDef, s as EntityDef } from "../config-BGT9h1OW.js";
2
- import { t as ReoptEavClient } from "../client-CJRjPSf7.js";
2
+ import { t as ReoptEavClient } from "../client-CyFOwE5p.js";
3
3
  //#region src/eav/schema/define.d.ts
4
4
  declare function defineEntity<const A extends Record<string, AttributeDef>>(def: EntityDef<A>): EntityDef<A>;
5
5
  declare function defineSchema<const E extends Record<string, EntityDef>>(def: SchemaDef<E>): SchemaDef<E>;
@@ -179,7 +179,7 @@ function diffEntity(key, def, server, deleteOrphans, lockfileAttrs) {
179
179
  const changes = {};
180
180
  if (def.name !== server.name) changes.name = def.name;
181
181
  if ((def.description ?? null) !== server.description) changes.description = def.description ?? null;
182
- if ((def.icon ?? null) !== server.icon) changes.icon = def.icon ?? null;
182
+ if (def.icon !== void 0 && def.icon !== server.icon) changes.icon = def.icon;
183
183
  const attributes = diffAttributes(def.attributes, server.attributes, deleteOrphans, lockfileAttrs);
184
184
  const hasAttrChanges = attributes.some((a) => a.type !== "unchanged");
185
185
  if (Object.keys(changes).length > 0) return {
@@ -1,3 +1,3 @@
1
- import { n as createReoptFeedbackClient, t as ReoptFeedbackClient } from "../client-CoaQxuaG.js";
1
+ import { n as createReoptFeedbackClient, t as ReoptFeedbackClient } from "../client-OEX6i4XJ.js";
2
2
 
3
3
  export { ReoptFeedbackClient, createReoptFeedbackClient };
@@ -25,7 +25,18 @@ type ImageLoaderArgs = {
25
25
  type ImageRemotePattern = {
26
26
  protocol: "https";
27
27
  hostname: string;
28
+ /** Next.js `remotePatterns` glob (e.g. `/api/blob/**`). Omitted = any path. */
29
+ pathname?: string;
28
30
  };
31
+ /**
32
+ * 🔑 `sdk.files`가 돌려주는 `url`은 Vercel Blob 직접 주소가 아니라 리옵트 서빙
33
+ * 프록시(`https://studio.reopt.ai/api/blob/...`)다 — 4.7.0-rc.13까지는 blob
34
+ * 호스트만 있어서 `next/image`가 실제 파일 URL을 거절했다.
35
+ *
36
+ * 로컬 리옵트(`https://studio.local.reopt.io`)는 루프백으로 풀려 Next.js가
37
+ * 패턴과 무관하게 최적화를 거절한다(`images.dangerouslyAllowLocalIP`) — 로컬에선
38
+ * `<Image unoptimized>`를 쓰거나 개발 설정에서만 그 옵션을 켠다.
39
+ */
29
40
  declare const REOPT_IMAGE_REMOTE_PATTERNS: ImageRemotePattern[];
30
41
  /**
31
42
  * src에 width / quality 쿼리를 추가. 잘못된 URL은 그대로 반환.
@@ -1,7 +1,20 @@
1
- import { n as createReoptFileClient, t as ReoptFileClient } from "../client-Do7Eny_J.js";
1
+ import { n as createReoptFileClient, t as ReoptFileClient } from "../client-Dn5CjA4d.js";
2
2
 
3
3
  //#region src/files/helpers.ts
4
+ /**
5
+ * 🔑 `sdk.files`가 돌려주는 `url`은 Vercel Blob 직접 주소가 아니라 리옵트 서빙
6
+ * 프록시(`https://studio.reopt.ai/api/blob/...`)다 — 4.7.0-rc.13까지는 blob
7
+ * 호스트만 있어서 `next/image`가 실제 파일 URL을 거절했다.
8
+ *
9
+ * 로컬 리옵트(`https://studio.local.reopt.io`)는 루프백으로 풀려 Next.js가
10
+ * 패턴과 무관하게 최적화를 거절한다(`images.dangerouslyAllowLocalIP`) — 로컬에선
11
+ * `<Image unoptimized>`를 쓰거나 개발 설정에서만 그 옵션을 켠다.
12
+ */
4
13
  const REOPT_IMAGE_REMOTE_PATTERNS = [{
14
+ protocol: "https",
15
+ hostname: "studio.reopt.ai",
16
+ pathname: "/api/blob/**"
17
+ }, {
5
18
  protocol: "https",
6
19
  hostname: "*.public.blob.vercel-storage.com"
7
20
  }];
@@ -1,4 +1,4 @@
1
- import { S as ReoptSDKError, a as resolveIdBaseUrl, i as resolveBaseUrl, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, w as ServerError, x as RateLimitError } from "./config-Cxv010M9.js";
1
+ import { S as ReoptSDKError, a as resolveIdBaseUrl, i as resolveBaseUrl, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, w as ServerError, x as RateLimitError } from "./config-DrtdQNzj.js";
2
2
  import { t as createAuthHeader } from "./encoding-Bwfm3iaE.js";
3
3
 
4
4
  //#region src/core/debug.ts
@@ -412,4 +412,4 @@ function parseFieldErrors(body) {
412
412
 
413
413
  //#endregion
414
414
  export { parseFieldErrors as n, BaseHttpClient as t };
415
- //# sourceMappingURL=http-client-COcHWJzo.js.map
415
+ //# sourceMappingURL=http-client-DQf8pVNw.js.map
@@ -3,7 +3,7 @@ import { t as ReoptAiClient } from "./client-CP1Jgq4R.js";
3
3
  import { t as ReoptAnalyticsClient } from "./client-CJFsLk3_.js";
4
4
  import { t as ReoptAuthClient } from "./client-BL-Ljwki.js";
5
5
  import { t as ReoptCmsClient } from "./client-NUhpPkl2.js";
6
- import { t as ReoptEavClient } from "./client-CJRjPSf7.js";
6
+ import { t as ReoptEavClient } from "./client-CyFOwE5p.js";
7
7
  import { t as ReoptFeedbackClient } from "./client-DF-tOyrY.js";
8
8
  import { t as ReoptFileClient } from "./client-wNzcgEJu.js";
9
9
  import { t as ReoptPlansClient } from "./client-CD6uK0dA.js";
@@ -197,4 +197,4 @@ type ReoptSDK<S extends SchemaDef = SchemaDef> = {
197
197
  declare function createReoptSDK<S extends SchemaDef = SchemaDef>(config: ReoptSDKConfig<S>): ReoptSDK<S>;
198
198
  //#endregion
199
199
  export { initReoptSDK as a, getReoptSDK as i, createReoptSDK as n, resetSDK as o, createLazySDK as r, BaseHttpClient as s, ReoptSDK as t };
200
- //# sourceMappingURL=index-CaXrNTtU.d.ts.map
200
+ //# sourceMappingURL=index-BQaGBa_K.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { a as DebugLogger, i as DebugLevel, n as ReoptSDKConfig, r as resolveBaseUrl, t as REOPT_BASE_URLS } from "./config-BGT9h1OW.js";
2
2
  import { C as StreamEvent, S as StreamDoneData, _ as ImageGenerateOptions, b as ModelInfo, d as EvaluateOptions, f as EvaluationAnswer, g as FinishReason, h as EvaluationResult, i as ChatMessage, m as EvaluationQuestion, o as CompletionOptions, p as EvaluationInput, r as AgentInfo, s as CompletionResult, u as CreditInfo, v as ImageGenerateResult, y as MessageRole } from "./client-CP1Jgq4R.js";
3
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-D-Va8oeC.js";
4
- import { i as TypedEavRecord, r as EntityClient } from "./client-CJRjPSf7.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-CaXrNTtU.js";
4
+ import { i as TypedEavRecord, r as EntityClient } from "./client-CyFOwE5p.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-BQaGBa_K.js";
6
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 EvaluateOptions, type EvaluationAnswer, type EvaluationInput, type EvaluationQuestion, type EvaluationResult, 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 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-Cxv010M9.js";
2
- import { t as BaseHttpClient } from "./http-client-COcHWJzo.js";
3
- import { n as createReoptAiClient } from "./client-D38XGQRR.js";
4
- import { n as createReoptAuthClient } from "./client-Ca_5meV_.js";
5
- import { t as createReoptCmsClient } from "./client-BBfRO86C.js";
6
- import { t as createReoptEavClient } from "./client-BF94tdhy.js";
7
- import { n as createReoptFeedbackClient } from "./client-CoaQxuaG.js";
8
- import { n as createReoptFileClient } from "./client-Do7Eny_J.js";
9
- import { n as createReoptAnalyticsClient } from "./client-DoK8YCd_.js";
10
- import { n as createReoptPlansClient } from "./client-BvgSoqAc.js";
11
- import { n as createReoptPushClient } from "./client-v7ed6KdC.js";
12
- import { n as createReoptTermsClient } from "./client-RnJg4AGr.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-DrtdQNzj.js";
2
+ import { t as BaseHttpClient } from "./http-client-DQf8pVNw.js";
3
+ import { n as createReoptAiClient } from "./client-DHmwj3qm.js";
4
+ import { n as createReoptAuthClient } from "./client-BH7PYWbE.js";
5
+ import { t as createReoptCmsClient } from "./client-BAr_BNfz.js";
6
+ import { t as createReoptEavClient } from "./client-loa5Z9hY.js";
7
+ import { n as createReoptFeedbackClient } from "./client-OEX6i4XJ.js";
8
+ import { n as createReoptFileClient } from "./client-Dn5CjA4d.js";
9
+ import { n as createReoptAnalyticsClient } from "./client-CU_ot3SS.js";
10
+ import { n as createReoptPlansClient } from "./client-BBx2uOT6.js";
11
+ import { n as createReoptPushClient } from "./client-Ce0z7WTl.js";
12
+ import { n as createReoptTermsClient } from "./client-CwfUFDWS.js";
13
13
 
14
14
  //#region src/singleton.ts
15
15
  let _instance;
@@ -1,7 +1,7 @@
1
- import { n as SDK_VERSION } from "../config-Cxv010M9.js";
1
+ import { n as SDK_VERSION } from "../config-DrtdQNzj.js";
2
2
  import { o as readClientKeyRing } from "../keys-B_R_lsyF.js";
3
- import { r as createMachineClient } from "../client-CDeaH7JC.js";
4
- import { S as platformBrandUpsertInputSchema, U as platformPipelineUpsertInputSchema, W as platformResourceKeySchema, j as platformErrorSchema, n as PlatformApiError, p as PLATFORM_OAUTH_CLIENT_PURPOSES, s as resolvePlatformUrls, w as platformBrandappUpsertInputSchema, y as PLATFORM_WEBHOOK_TRIGGERS } from "../client-B2nwOzdZ.js";
3
+ import { r as createMachineClient } from "../client-OHAVqTBu.js";
4
+ import { S as platformBrandUpsertInputSchema, U as platformPipelineUpsertInputSchema, W as platformResourceKeySchema, j as platformErrorSchema, n as PlatformApiError, p as PLATFORM_OAUTH_CLIENT_PURPOSES, s as resolvePlatformUrls, w as platformBrandappUpsertInputSchema, y as PLATFORM_WEBHOOK_TRIGGERS } from "../client-BLmIi1fg.js";
5
5
  import * as jose from "jose";
6
6
  import { z } from "zod";
7
7
 
@@ -1,4 +1,4 @@
1
- import { S as ReoptSDKError, a as resolveIdBaseUrl } from "../config-Cxv010M9.js";
1
+ import { S as ReoptSDKError, a as resolveIdBaseUrl } from "../config-DrtdQNzj.js";
2
2
 
3
3
  //#region src/logout/verify.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
1
  import { a as parseClientPrivateJwk, i as generateClientKeyPair, n as DEFAULT_CLIENT_KEY_ALGORITHM, o as readClientKeyRing, r as buildClientJwks, s as toPublicJwk, t as CLIENT_JWKS_PATH } from "../keys-B_R_lsyF.js";
2
- import { n as createDpopProof, r as createMachineClient, t as MachineTokenError } from "../client-CDeaH7JC.js";
2
+ import { n as createDpopProof, r as createMachineClient, t as MachineTokenError } from "../client-OHAVqTBu.js";
3
3
 
4
4
  export { CLIENT_JWKS_PATH, DEFAULT_CLIENT_KEY_ALGORITHM, MachineTokenError, buildClientJwks, createDpopProof, createMachineClient, generateClientKeyPair, parseClientPrivateJwk, readClientKeyRing, toPublicJwk };
@@ -1,3 +1,3 @@
1
- import { n as createReoptPlansClient, t as ReoptPlansClient } from "../client-BvgSoqAc.js";
1
+ import { n as createReoptPlansClient, t as ReoptPlansClient } from "../client-BBx2uOT6.js";
2
2
 
3
3
  export { ReoptPlansClient, createReoptPlansClient };
@@ -1,3 +1,3 @@
1
- import { n as createReoptPushClient, t as ReoptPushClient } from "../client-v7ed6KdC.js";
1
+ import { n as createReoptPushClient, t as ReoptPushClient } from "../client-Ce0z7WTl.js";
2
2
 
3
3
  export { ReoptPushClient, createReoptPushClient };
@@ -1,4 +1,4 @@
1
- import { S as ReoptSDKError } from "./config-Cxv010M9.js";
1
+ import { S as ReoptSDKError } from "./config-DrtdQNzj.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-Ch_JZ5Bd.js.map
35
+ //# sourceMappingURL=query-ktdIV5kz.js.map
@@ -3,7 +3,7 @@ import { S as StreamDoneData, _ as ImageGenerateOptions, b as ModelInfo, o as Co
3
3
  import { v as ReoptSDKError } from "../errors-D-Va8oeC.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
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-wNzcgEJu.js";
6
- import { t as ReoptSDK } from "../index-CaXrNTtU.js";
6
+ import { t as ReoptSDK } from "../index-BQaGBa_K.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 = {
@@ -1,4 +1,4 @@
1
- import { i as REOPT_PLATFORM_URLS, n as PlatformApiError, o as createPlatformRequester, r as REOPT_PLATFORM_ID_URLS, s as resolvePlatformUrls } from "../client-B2nwOzdZ.js";
1
+ import { i as REOPT_PLATFORM_URLS, n as PlatformApiError, o as createPlatformRequester, r as REOPT_PLATFORM_ID_URLS, s as resolvePlatformUrls } from "../client-BLmIi1fg.js";
2
2
  import { z } from "zod";
3
3
 
4
4
  //#region src/social/schemas.ts
@@ -1,3 +1,3 @@
1
- import { n as createReoptTermsClient, t as ReoptTermsClient } from "../client-RnJg4AGr.js";
1
+ import { n as createReoptTermsClient, t as ReoptTermsClient } from "../client-CwfUFDWS.js";
2
2
 
3
3
  export { ReoptTermsClient, createReoptTermsClient };
@@ -1,5 +1,5 @@
1
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-Dh8XMVFF.js";
2
- import { t as ReoptSDK } from "../index-CaXrNTtU.js";
2
+ import { t as ReoptSDK } from "../index-BQaGBa_K.js";
3
3
  //#region src/testing/index.d.ts
4
4
  type TestSDKOptions = {
5
5
  /** EAV schema to seed entities and attributes */
@@ -1,3 +1,3 @@
1
- import { $ as platformWebhookUpsertInputSchema, A as platformEavSchemaOperationSchema, B as platformPipelineResourceSchema, C as platformBrandappResourceSchema, D as platformEavEntityResourceSchema, E as platformEavBrandappResourcesSchema, F as platformMeSchema, G as platformResourcesSchema, H as platformPipelineStageInputSchema, I as platformOAuthClientImportInputSchema, J as platformTaskStageInputSchema, K as platformResourcesV2Schema, L as platformOAuthClientResourceSchema, M as platformExternalIdSchema, N as platformLockAcquiredSchema, O as platformEavSchemaApplyInputSchema, P as platformLockReleasedSchema, Q as platformWebhookSchema, R as platformOAuthClientUpsertInputSchema, S as platformBrandUpsertInputSchema, T as platformCustomerUpsertInputSchema, U as platformPipelineUpsertInputSchema, V as platformPipelineSchema, W as platformResourceKeySchema, X as platformTaskUpsertInputSchema, Y as platformTaskStageSchema, Z as platformWebhookResourceSchema, _ as PLATFORM_TASK_PRIORITIES, a as createPlatformClient, b as platformBrandImportInputSchema, c as PLATFORM_ADMIN_SCOPE, d as PLATFORM_MANAGED_BY_VALUES, et as platformWorkTaskStageChangedEventSchema, f as PLATFORM_OAUTH_APPLICATION_TYPES, g as PLATFORM_TASK_OUTCOMES, h as PLATFORM_STAGE_COLORS, i as REOPT_PLATFORM_URLS, j as platformErrorSchema, k as platformEavSchemaApplyResultSchema, l as PLATFORM_BRANDAPP_STATUSES, m as PLATFORM_OAUTH_GRANT_TYPES, n as PlatformApiError, p as PLATFORM_OAUTH_CLIENT_PURPOSES, q as platformTaskSchema, r as REOPT_PLATFORM_ID_URLS, s as resolvePlatformUrls, t as DEFAULT_PLATFORM_SCOPES, tt as platformWriteMetaSchema, u as PLATFORM_DOMAIN_STATUSES, v as PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS, w as platformBrandappUpsertInputSchema, x as platformBrandResourceSchema, y as PLATFORM_WEBHOOK_TRIGGERS, z as platformPipelineImportInputSchema } from "../client-B2nwOzdZ.js";
1
+ import { $ as platformWebhookUpsertInputSchema, A as platformEavSchemaOperationSchema, B as platformPipelineResourceSchema, C as platformBrandappResourceSchema, D as platformEavEntityResourceSchema, E as platformEavBrandappResourcesSchema, F as platformMeSchema, G as platformResourcesSchema, H as platformPipelineStageInputSchema, I as platformOAuthClientImportInputSchema, J as platformTaskStageInputSchema, K as platformResourcesV2Schema, L as platformOAuthClientResourceSchema, M as platformExternalIdSchema, N as platformLockAcquiredSchema, O as platformEavSchemaApplyInputSchema, P as platformLockReleasedSchema, Q as platformWebhookSchema, R as platformOAuthClientUpsertInputSchema, S as platformBrandUpsertInputSchema, T as platformCustomerUpsertInputSchema, U as platformPipelineUpsertInputSchema, V as platformPipelineSchema, W as platformResourceKeySchema, X as platformTaskUpsertInputSchema, Y as platformTaskStageSchema, Z as platformWebhookResourceSchema, _ as PLATFORM_TASK_PRIORITIES, a as createPlatformClient, b as platformBrandImportInputSchema, c as PLATFORM_ADMIN_SCOPE, d as PLATFORM_MANAGED_BY_VALUES, et as platformWorkTaskStageChangedEventSchema, f as PLATFORM_OAUTH_APPLICATION_TYPES, g as PLATFORM_TASK_OUTCOMES, h as PLATFORM_STAGE_COLORS, i as REOPT_PLATFORM_URLS, j as platformErrorSchema, k as platformEavSchemaApplyResultSchema, l as PLATFORM_BRANDAPP_STATUSES, m as PLATFORM_OAUTH_GRANT_TYPES, n as PlatformApiError, p as PLATFORM_OAUTH_CLIENT_PURPOSES, q as platformTaskSchema, r as REOPT_PLATFORM_ID_URLS, s as resolvePlatformUrls, t as DEFAULT_PLATFORM_SCOPES, tt as platformWriteMetaSchema, u as PLATFORM_DOMAIN_STATUSES, v as PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS, w as platformBrandappUpsertInputSchema, x as platformBrandResourceSchema, y as PLATFORM_WEBHOOK_TRIGGERS, z as platformPipelineImportInputSchema } from "../client-BLmIi1fg.js";
2
2
 
3
3
  export { DEFAULT_PLATFORM_SCOPES, PLATFORM_ADMIN_SCOPE, PLATFORM_BRANDAPP_STATUSES, PLATFORM_DOMAIN_STATUSES, PLATFORM_MANAGED_BY_VALUES, PLATFORM_OAUTH_APPLICATION_TYPES, PLATFORM_OAUTH_CLIENT_PURPOSES, PLATFORM_OAUTH_GRANT_TYPES, PLATFORM_STAGE_COLORS, PLATFORM_TASK_OUTCOMES, PLATFORM_TASK_PRIORITIES, PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS, PLATFORM_WEBHOOK_TRIGGERS, PlatformApiError, REOPT_PLATFORM_ID_URLS, REOPT_PLATFORM_URLS, createPlatformClient, platformBrandImportInputSchema, platformBrandResourceSchema, platformBrandUpsertInputSchema, platformBrandappResourceSchema, platformBrandappUpsertInputSchema, platformCustomerUpsertInputSchema, platformEavBrandappResourcesSchema, platformEavEntityResourceSchema, platformEavSchemaApplyInputSchema, platformEavSchemaApplyResultSchema, platformEavSchemaOperationSchema, platformErrorSchema, platformExternalIdSchema, platformLockAcquiredSchema, platformLockReleasedSchema, platformMeSchema, platformOAuthClientImportInputSchema, platformOAuthClientResourceSchema, platformOAuthClientUpsertInputSchema, platformPipelineImportInputSchema, platformPipelineResourceSchema, platformPipelineSchema, platformPipelineStageInputSchema, platformPipelineUpsertInputSchema, platformResourceKeySchema, platformResourcesSchema, platformResourcesV2Schema, platformTaskSchema, platformTaskStageInputSchema, platformTaskStageSchema, platformTaskUpsertInputSchema, platformWebhookResourceSchema, platformWebhookSchema, platformWebhookUpsertInputSchema, platformWorkTaskStageChangedEventSchema, platformWriteMetaSchema, resolvePlatformUrls };
@@ -590,7 +590,8 @@ SQL로 좁혀지지 않는 필터로 큰 엔티티를 훑어도 `QUERY_TOO_BROAD
590
590
  ```typescript
591
591
  import { where, createFilterBuilder } from "@reopt-ai/brandapp-sdk/eav";
592
592
 
593
- // Name-based (simple)
593
+ // Name-based — sdk.eav.entity(name)의 records.*에서만 통한다(클라이언트가 이름을 ID로 바꾼다).
594
+ // ID 키 원시 API(sdk.eav.records.*)에 넘기면 서버가 모르는 속성으로 본다 → 아래 ID 기반을 쓴다.
594
595
  where("status").eq("active");
595
596
  where("age").gte(18);
596
597
  where("deletedAt").isNull();
@@ -77,7 +77,12 @@ await dev.seed({
77
77
  });
78
78
  ```
79
79
 
80
- 엔티티 이름은 스키마에 정의된 이름과 일치해야 합니다.
80
+ 엔티티 이름은 스키마에 정의된 이름과 일치해야 합니다. 값은 속성 이름 키로 적고, dev 서버가 그 엔티티의
81
+ 속성 ID로 바꿔 저장합니다.
82
+
83
+ > dev 서버는 실서버처럼 속성마다 ID를 따로 발급하고(4.7.0-rc.14~), 레코드 쓰기에서 그 엔티티의 속성 ID가
84
+ > 아닌 키를 버립니다. 이름 키로 읽고 쓰려면 `sdk.eav.entity(name)`을 쓰세요 — 원시 API(`sdk.eav.records.*`)는
85
+ > 속성 ID 키입니다.
81
86
 
82
87
  ---
83
88
 
package/docs/files.md CHANGED
@@ -425,6 +425,11 @@ export default config;
425
425
 
426
426
  현재 포함되는 호스트:
427
427
 
428
- - `*.public.blob.vercel-storage.com` (Vercel Blob 기본 도메인)
428
+ - `studio.reopt.ai` + `/api/blob/**` — `sdk.files`가 돌려주는 `url`의 실제 호스트(리옵트 서빙 프록시)
429
+ - `*.public.blob.vercel-storage.com` (Vercel Blob 기본 도메인, 레거시 직접 URL)
430
+
431
+ 로컬 리옵트(`https://studio.local.reopt.io/api/blob/...`)는 루프백 주소로 풀리기
432
+ 때문에 Next.js가 `remotePatterns`와 무관하게 최적화를 거절한다. 로컬에서는
433
+ `<Image unoptimized>`를 쓰거나, 개발 설정에서만 `images.dangerouslyAllowLocalIP: true`를 켠다.
429
434
 
430
435
  향후 reopt가 도입하는 이미지 호스트는 SDK 업그레이드만으로 자동 반영된다.
package/docs/testing.md CHANGED
@@ -41,10 +41,10 @@ describe("contacts", () => {
41
41
  });
42
42
 
43
43
  it("creates a contact", async () => {
44
- const entities = await testCtx.sdk.eav.entities.list();
45
- const contacts = entities.find((e) => e.name === "contacts");
46
-
47
- const record = await testCtx.sdk.eav.records.create(contacts.id, {
44
+ // entity(name)은 속성 이름 ↔ 속성 ID를 바꿔 준다. dev 서버도 실서버처럼
45
+ // 속성 ID를 따로 발급하므로, ID 키 원시 API(sdk.eav.records.*)에 이름 키를
46
+ // 넘기면 값이 버려진다.
47
+ const record = await testCtx.sdk.eav.entity("contacts").records.create({
48
48
  values: { name: "Alice", email: "alice@test.com" },
49
49
  });
50
50
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reopt-ai/brandapp-sdk",
3
- "version": "4.7.0-rc.13",
3
+ "version": "4.7.0-rc.14",
4
4
  "description": "Reopt Brandapp SDK — Better Auth adapter, OAuth login, and EAV client",
5
5
  "author": "Reopt",
6
6
  "license": "MIT",