@reopt-ai/brandapp-sdk 4.1.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -2
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.js +1 -1
- package/dist/ai-provider/index.js +2 -2
- package/dist/analytics/index.d.ts +1 -1
- package/dist/analytics/index.js +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/better-auth/index.d.ts +12 -2
- package/dist/better-auth/index.js +8 -3
- package/dist/{client-Ckm-i_Du.d.ts → client-B4CiEei5.d.ts} +7 -5
- package/dist/{client-DHZ484kb.d.ts → client-BBxhqs8l.d.ts} +2 -2
- package/dist/{client-CTefnLKY.js → client-BD1-resY.js} +3 -3
- package/dist/{client-Dx3sYx7V.js → client-BMgVQ4U-.js} +8 -8
- package/dist/{client-A4YrHjDc.d.ts → client-BOEyVc8V.d.ts} +2 -2
- package/dist/{client-DE3FvPFs.js → client-BVvAfEXG.js} +2 -2
- package/dist/{client-Dnp7_J0-.js → client-BpEWDfSl.js} +2 -2
- package/dist/{client-CP9RSAzn.js → client-CIUecAJE.js} +2 -2
- package/dist/{client-yBQen4Yi.d.ts → client-CNPfjmT0.d.ts} +2 -2
- package/dist/{client-BGLDrf3N.d.ts → client-CRim5LCH.d.ts} +2 -2
- package/dist/{client-CHp-oNJB.js → client-CaWHvclV.js} +3 -3
- package/dist/{client-D_7G37OB.js → client-D4kUDFwW.js} +2 -2
- package/dist/{client-DZu4msTG.d.ts → client-D5F6-YYU.d.ts} +2 -2
- package/dist/{client-DPbXH8tr.d.ts → client-DA9ibl3G.d.ts} +10 -10
- package/dist/{client-BTS6Ewv_.d.ts → client-DYammrtw.d.ts} +2 -2
- package/dist/{client-CAGo56KO.d.ts → client-DjgoTlfv.d.ts} +2 -2
- package/dist/{client-2IaU8yUs.js → client-Hc7SfeIf.js} +2 -2
- package/dist/{client-DfEeaOsQ.d.ts → client-bXAnGNzC.d.ts} +2 -2
- package/dist/{client-SwByFT8p.js → client-p4LmfF27.js} +2 -2
- package/dist/{client-mvcEj1Vq.js → client-vjIDamSf.js} +3 -3
- package/dist/cms/index.d.ts +1 -1
- package/dist/cms/index.js +1 -1
- package/dist/{config-C7WQtC3l.d.ts → config-D28P8iwm.d.ts} +42 -4
- package/dist/{config-tEsB7QhQ.js → config-D8dSL6OQ.js} +20 -6
- package/dist/dev/index.d.ts +1 -1
- package/dist/dev/index.js +114 -21
- package/dist/eav/index.d.ts +13 -4
- package/dist/eav/index.js +46 -3
- package/dist/eav/migrate.d.ts +4 -4
- package/dist/eav/migrate.js +1 -1
- package/dist/eav/schema.d.ts +2 -2
- package/dist/{errors-CRCcErNC.d.ts → errors-U3TsyWVq.d.ts} +10 -3
- package/dist/feedback/index.d.ts +1 -1
- package/dist/feedback/index.js +1 -1
- package/dist/files/index.d.ts +1 -1
- package/dist/files/index.js +1 -1
- package/dist/{http-client-CCFmwnaQ.js → http-client-0Sp8wQGQ.js} +2 -2
- package/dist/{index-DV_OWwx5.d.ts → index-C6fyJTud.d.ts} +7 -1
- package/dist/{index-DJMr3ixA.d.ts → index-DwIr8W3Y.d.ts} +12 -12
- package/dist/index.d.ts +6 -6
- package/dist/index.js +13 -13
- package/dist/logout/index.d.ts +1 -1
- package/dist/logout/index.js +1 -1
- package/dist/plans/index.d.ts +1 -1
- package/dist/plans/index.js +1 -1
- package/dist/push/index.d.ts +1 -1
- package/dist/push/index.js +1 -1
- package/dist/{query-Bsgb85OE.js → query-C18XolkY.js} +2 -2
- package/dist/react/hooks.d.ts +6 -6
- package/dist/react/hooks.js +1 -1
- package/dist/terms/index.d.ts +1 -1
- package/dist/terms/index.js +1 -1
- package/dist/testing/index.d.ts +2 -2
- package/docs/api-reference.md +38 -1
- package/docs/dev-server.md +1 -1
- package/docs/errors.md +18 -16
- package/package.json +1 -1
|
@@ -90,22 +90,60 @@ type EavRecord = {
|
|
|
90
90
|
values: Record<string, unknown>;
|
|
91
91
|
createdAt: string;
|
|
92
92
|
updatedAt: string;
|
|
93
|
+
/**
|
|
94
|
+
* 낙관적 동시성 토큰 — 값 갱신(update·bulkUpdate·upsert·increments)마다 +1.
|
|
95
|
+
* `update(..., { ifVersion })`에 되돌려 보내면 그 사이 다른 쓰기가 있었을 때
|
|
96
|
+
* `PreconditionFailedError`(412)로 거부된다. brandappAuthUser 연결 엔티티는 항상 1.
|
|
97
|
+
*/
|
|
98
|
+
version: number;
|
|
99
|
+
/** TTL — 지나면 읽기·유일성 검사에서 사라지고 서버 크론이 물리 삭제한다. */
|
|
100
|
+
expiresAt: string | null;
|
|
93
101
|
};
|
|
94
102
|
type CreateRecordInput = {
|
|
95
103
|
authUserId?: string;
|
|
96
104
|
values: Record<string, unknown>;
|
|
105
|
+
/** ISO 8601 TTL. brandapp 자유 테이블 전용. */
|
|
106
|
+
expiresAt?: string;
|
|
97
107
|
};
|
|
98
108
|
type UpdateRecordInput = {
|
|
99
|
-
|
|
109
|
+
/** 병합할 값. increments·expiresAt만 보낼 때는 생략 가능. */
|
|
110
|
+
values?: Record<string, unknown>;
|
|
111
|
+
/** 읽은 `EavRecord.version`. 불일치면 412 `PreconditionFailedError`. */
|
|
112
|
+
ifVersion?: number;
|
|
113
|
+
/** number 속성 원자 가감 `{ [attributeId]: delta }` — 동시 호출이 서로를 잃지 않는다. */
|
|
114
|
+
increments?: Record<string, number>;
|
|
115
|
+
/** ISO 8601이면 TTL 설정, `null`이면 해제. */
|
|
116
|
+
expiresAt?: string | null;
|
|
100
117
|
};
|
|
101
118
|
type BulkUpdateItem = {
|
|
102
119
|
id: string;
|
|
103
120
|
values: Record<string, unknown>;
|
|
104
121
|
};
|
|
105
|
-
|
|
122
|
+
/**
|
|
123
|
+
* Every filter operator the EAV record endpoints accept.
|
|
124
|
+
*
|
|
125
|
+
* Exported as a runtime value on purpose: the type alone cannot be compared
|
|
126
|
+
* against anything at test time, and this vocabulary is a copy — the server
|
|
127
|
+
* owns it in `apps/web/server/hono/routes/brandapp-eav-schemas.ts` and this
|
|
128
|
+
* package cannot import across the deployment boundary. The copy is held to
|
|
129
|
+
* the original by `apps/web/server/mcp/__tests__/eav-filter-operator-parity.test.ts`,
|
|
130
|
+
* which reads *this* array rather than a hand-written list.
|
|
131
|
+
*/
|
|
132
|
+
declare const ATTRIBUTE_FILTER_OPERATORS: readonly ["eq", "neq", "contains", "gt", "lt", "gte", "lte", "is_null", "is_not_null", "after", "before", "in", "not_in"];
|
|
133
|
+
type AttributeFilterOperator = (typeof ATTRIBUTE_FILTER_OPERATORS)[number];
|
|
134
|
+
/** Scalar accepted inside an `in` / `not_in` list. */
|
|
135
|
+
type AttributeFilterListValue = string | number | boolean | null;
|
|
136
|
+
/** Maximum number of entries in one `in` / `not_in` list (server-enforced). */
|
|
137
|
+
declare const ATTRIBUTE_FILTER_LIST_MAX = 100;
|
|
106
138
|
type AttributeFilter = {
|
|
107
139
|
attributeId: string;
|
|
108
140
|
operator: AttributeFilterOperator;
|
|
141
|
+
/**
|
|
142
|
+
* `in` / `not_in` require a non-empty array of at most
|
|
143
|
+
* {@link ATTRIBUTE_FILTER_LIST_MAX} scalars; the server rejects an empty one
|
|
144
|
+
* with 400 rather than reading it as "no exclusions", because a `not_in: []`
|
|
145
|
+
* that silently matched everything would turn a `deleteWhere` into a wipe.
|
|
146
|
+
*/
|
|
109
147
|
value?: unknown;
|
|
110
148
|
};
|
|
111
149
|
type PaginatedResponse<T> = {
|
|
@@ -392,5 +430,5 @@ type ReoptSDKConfig<S extends SchemaDef = SchemaDef> = {
|
|
|
392
430
|
*/
|
|
393
431
|
declare function resolveBaseUrl(config: ReoptSDKConfig): string;
|
|
394
432
|
//#endregion
|
|
395
|
-
export {
|
|
396
|
-
//# sourceMappingURL=config-
|
|
433
|
+
export { ListRecordsQuery as A, EavAttribute as C, EavRecord as D, EavEntity as E, UpsertRecordInput as F, UpsertRecordResult as I, UpdateAttributeInput as M, UpdateEntityInput as N, EavSchemaLinkedTo as O, UpdateRecordInput as P, DeleteWhereInput as S, EavDataType as T, BulkUpdateItem as _, DebugLogger as a, CreateEntityInput as b, InferValues as c, ATTRIBUTE_FILTER_OPERATORS as d, AttributeFilter as f, BackfillResult as g, BackfillOptions as h, DebugLevel as i, PaginatedResponse as j, EavValidation as k, SchemaDef as l, AttributeFilterOperator as m, ReoptSDKConfig as n, AttributeDef as o, AttributeFilterListValue as p, resolveBaseUrl as r, EntityDef as s, REOPT_BASE_URLS as t, ATTRIBUTE_FILTER_LIST_MAX as u, CountRecordsQuery as v, EavAttributeOption as w, CreateRecordInput as x, CreateAttributeInput as y };
|
|
434
|
+
//# sourceMappingURL=config-D28P8iwm.d.ts.map
|
|
@@ -44,12 +44,12 @@ var ServerError = class extends ReoptSDKError {
|
|
|
44
44
|
this.name = "ServerError";
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
/** AI
|
|
47
|
+
/** AI 사용량 잔액 부족 (HTTP 402). */
|
|
48
48
|
var CreditLimitError = class extends ReoptSDKError {
|
|
49
49
|
constructor(message = "Insufficient AI credits", context, code = "CREDIT_LIMIT") {
|
|
50
50
|
super(message, 402, code, context, {
|
|
51
|
-
cause: "BrandApp AI
|
|
52
|
-
fix: "Studio → BrandApp → AI
|
|
51
|
+
cause: "BrandApp AI 사용량 잔액 부족",
|
|
52
|
+
fix: "Studio → BrandApp → AI 사용량 페이지에서 충전",
|
|
53
53
|
doc: "docs/errors.md#credit_limit"
|
|
54
54
|
});
|
|
55
55
|
this.name = "CreditLimitError";
|
|
@@ -142,6 +142,19 @@ var DuplicateAuthUserError = class extends ConflictError {
|
|
|
142
142
|
}
|
|
143
143
|
};
|
|
144
144
|
/** 참조한 brandappAuthUser가 이 brandapp에 존재하지 않음. status는 호출 경로에 따라 400 또는 422. */
|
|
145
|
+
/**
|
|
146
|
+
* 412 — `update(..., { ifVersion })`의 version이 현재와 다르다. 레코드를 다시 읽어
|
|
147
|
+
* 새 `version`으로 재시도할 것(CAS 루프).
|
|
148
|
+
*/
|
|
149
|
+
var PreconditionFailedError = class extends ReoptSDKError {
|
|
150
|
+
constructor(message, context) {
|
|
151
|
+
super(message, 412, "PRECONDITION_FAILED", context, {
|
|
152
|
+
cause: "레코드가 읽은 뒤 다른 쓰기로 바뀌었습니다(ifVersion 불일치).",
|
|
153
|
+
fix: "레코드를 다시 읽고 새 version으로 다시 시도하세요(CAS 루프)."
|
|
154
|
+
});
|
|
155
|
+
this.name = "PreconditionFailedError";
|
|
156
|
+
}
|
|
157
|
+
};
|
|
145
158
|
var AuthUserNotFoundError = class extends ReoptSDKError {
|
|
146
159
|
constructor(message = "Auth user not found in this brandapp", status = 422, context) {
|
|
147
160
|
super(message, status, "AUTH_USER_NOT_FOUND", context, {
|
|
@@ -285,6 +298,7 @@ function mapHttpStatusToError(status, code, message, ctx, fieldErrors) {
|
|
|
285
298
|
case 404:
|
|
286
299
|
if (code === "MODEL_NOT_FOUND") return new ModelNotFoundError(message ?? "Unknown model", ctx);
|
|
287
300
|
return new NotFoundError(message ?? "Not found", ctx, code ?? "NOT_FOUND");
|
|
301
|
+
case 412: return new PreconditionFailedError(message ?? "Precondition failed", ctx);
|
|
288
302
|
case 409:
|
|
289
303
|
if (code === "AUTH_USER_RECORD_EXISTS") return new AuthUserRecordExistsError(message ?? "Auth user already has a record for this entity", ctx);
|
|
290
304
|
if (code === "DUPLICATE_AUTH_USER") return new DuplicateAuthUserError(message ?? "Duplicate authUserId in bulk create", ctx);
|
|
@@ -305,7 +319,7 @@ function mapHttpStatusToError(status, code, message, ctx, fieldErrors) {
|
|
|
305
319
|
|
|
306
320
|
//#endregion
|
|
307
321
|
//#region src/core/config.ts
|
|
308
|
-
const SDK_VERSION = "4.
|
|
322
|
+
const SDK_VERSION = "4.2.0";
|
|
309
323
|
/**
|
|
310
324
|
* Default API host for EAV / AI / Files / CMS / Terms. Consumers can override
|
|
311
325
|
* via `config.baseUrl` or the `REOPT_BASE_URL` env var.
|
|
@@ -483,5 +497,5 @@ function deriveIdFromBaseUrl(baseUrl) {
|
|
|
483
497
|
}
|
|
484
498
|
|
|
485
499
|
//#endregion
|
|
486
|
-
export {
|
|
487
|
-
//# sourceMappingURL=config-
|
|
500
|
+
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 };
|
|
501
|
+
//# sourceMappingURL=config-D8dSL6OQ.js.map
|
package/dist/dev/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as DevPost, a as SeedAllInput, b as InMemoryStore, c as SeedPostGroupInput, d as SeedTermsItem, f as createDevServer, g as DevEntity, h as DevAttribute, i as ProxyConfig, l as SeedPostInput, m as markdownToEditorSpecMany, n as DevServer, o as SeedData, p as markdownToEditorSpec, r as DevServerOptions, s as SeedOptions, t as DevSchema, u as SeedRecordInput, v as DevPostGroup, x as StoreSnapshot, y as DevRecord } from "../index-
|
|
1
|
+
import { _ as DevPost, a as SeedAllInput, b as InMemoryStore, c as SeedPostGroupInput, d as SeedTermsItem, f as createDevServer, g as DevEntity, h as DevAttribute, i as ProxyConfig, l as SeedPostInput, m as markdownToEditorSpecMany, n as DevServer, o as SeedData, p as markdownToEditorSpec, r as DevServerOptions, s as SeedOptions, t as DevSchema, u as SeedRecordInput, v as DevPostGroup, x as StoreSnapshot, y as DevRecord } from "../index-C6fyJTud.js";
|
|
2
2
|
export { type DevAttribute, type DevEntity, type DevPost, type DevPostGroup, type DevRecord, DevSchema, DevServer, DevServerOptions, InMemoryStore, ProxyConfig, SeedAllInput, SeedData, SeedOptions, SeedPostGroupInput, SeedPostInput, SeedRecordInput, SeedTermsItem, type StoreSnapshot, createDevServer, markdownToEditorSpec, markdownToEditorSpecMany };
|
package/dist/dev/index.js
CHANGED
|
@@ -11,6 +11,10 @@ import { randomUUID } from "node:crypto";
|
|
|
11
11
|
* Map-based storage that mirrors the production Prisma models.
|
|
12
12
|
* Supports JSON serialization for persistence across restarts.
|
|
13
13
|
*/
|
|
14
|
+
/** 만료되지 않은 레코드만 "존재"한다 — production `("expiresAt" IS NULL OR > NOW())`와 같은 술어. */
|
|
15
|
+
function isRecordAlive(record, now) {
|
|
16
|
+
return record.expiresAt === null || record.expiresAt.getTime() > now.getTime();
|
|
17
|
+
}
|
|
14
18
|
var InMemoryStore = class {
|
|
15
19
|
entities = /* @__PURE__ */ new Map();
|
|
16
20
|
attributes = /* @__PURE__ */ new Map();
|
|
@@ -53,7 +57,18 @@ var InMemoryStore = class {
|
|
|
53
57
|
return this.findMany(this.attributes, (a) => a.entityId === entityId).sort((a, b) => a.sortOrder - b.sortOrder);
|
|
54
58
|
}
|
|
55
59
|
getRecordsByEntity(entityId) {
|
|
56
|
-
|
|
60
|
+
const now = this.now();
|
|
61
|
+
return this.findMany(this.records, (r) => r.entityId === entityId && isRecordAlive(r, now));
|
|
62
|
+
}
|
|
63
|
+
/** 만료된 행 물리 삭제 — production 크론 `/api/cron/eav-record-expire` 미러. */
|
|
64
|
+
purgeExpiredRecords() {
|
|
65
|
+
const now = this.now();
|
|
66
|
+
let purged = 0;
|
|
67
|
+
for (const [id, record] of this.records) if (!isRecordAlive(record, now)) {
|
|
68
|
+
this.records.delete(id);
|
|
69
|
+
purged += 1;
|
|
70
|
+
}
|
|
71
|
+
return purged;
|
|
57
72
|
}
|
|
58
73
|
getRecordValues(recordId) {
|
|
59
74
|
return this.records.get(recordId)?.values ?? [];
|
|
@@ -227,12 +242,21 @@ var InMemoryStore = class {
|
|
|
227
242
|
* mirroring brandapp-eav-operations.ts logic.
|
|
228
243
|
*/
|
|
229
244
|
const LIMITS = {
|
|
230
|
-
ENTITIES_PER_BRANDAPP: 50,
|
|
231
245
|
ATTRIBUTES_PER_ENTITY: 100,
|
|
232
|
-
RECORDS_PER_ENTITY: 1e4,
|
|
233
246
|
/** Max records per bulk operation (matches production API). */
|
|
234
247
|
BULK_BATCH_SIZE: 100
|
|
235
248
|
};
|
|
249
|
+
/**
|
|
250
|
+
* Records per entity — mirrors production, where the default of 10,000 can be raised
|
|
251
|
+
* with `BRANDAPP_EAV_MAX_RECORDS_PER_ENTITY` (the in-memory fallback path is bounded
|
|
252
|
+
* separately there, so raising it is safe). Read lazily so tests can stub the env.
|
|
253
|
+
*/
|
|
254
|
+
function resolveRecordLimit() {
|
|
255
|
+
const raw = process.env.BRANDAPP_EAV_MAX_RECORDS_PER_ENTITY?.trim();
|
|
256
|
+
if (!raw) return 1e4;
|
|
257
|
+
const parsed = Number(raw);
|
|
258
|
+
return Number.isSafeInteger(parsed) && parsed > 0 ? parsed : 1e4;
|
|
259
|
+
}
|
|
236
260
|
function bulkSizeError(op, got) {
|
|
237
261
|
return {
|
|
238
262
|
ok: false,
|
|
@@ -345,11 +369,21 @@ function compareOrderableValues(left, right, mode) {
|
|
|
345
369
|
if (typeof left === "string" && typeof right === "string") return left.localeCompare(right);
|
|
346
370
|
return null;
|
|
347
371
|
}
|
|
372
|
+
/** `eq`의 동등 규칙 한 벌 — `in`/`not_in`이 이것의 집합 확장이다(서버와 같은 구조). */
|
|
373
|
+
function equalsFilterValue(recordValue, filterValue) {
|
|
374
|
+
return serializeValue(recordValue) === serializeValue(filterValue);
|
|
375
|
+
}
|
|
348
376
|
function matchesFilter(record, filter) {
|
|
349
377
|
const { exists, value } = getRecordValue(record, filter.attributeId);
|
|
350
378
|
switch (filter.operator) {
|
|
351
|
-
case "eq": return exists &&
|
|
352
|
-
case "neq": return !exists ||
|
|
379
|
+
case "eq": return exists && equalsFilterValue(value, filter.value);
|
|
380
|
+
case "neq": return !exists || !equalsFilterValue(value, filter.value);
|
|
381
|
+
case "in":
|
|
382
|
+
if (!Array.isArray(filter.value)) return false;
|
|
383
|
+
return exists && filter.value.some((c) => equalsFilterValue(value, c));
|
|
384
|
+
case "not_in":
|
|
385
|
+
if (!Array.isArray(filter.value)) return false;
|
|
386
|
+
return !exists || !filter.value.some((c) => equalsFilterValue(value, c));
|
|
353
387
|
case "contains": return exists && serializeValue(value).includes(serializeValue(filter.value));
|
|
354
388
|
case "gt": {
|
|
355
389
|
const c = compareOrderableValues(value, filter.value, "general");
|
|
@@ -377,7 +411,7 @@ function matchesFilter(record, filter) {
|
|
|
377
411
|
}
|
|
378
412
|
case "is_null": return !exists || value === null;
|
|
379
413
|
case "is_not_null": return exists && value !== null;
|
|
380
|
-
default: return
|
|
414
|
+
default: return false;
|
|
381
415
|
}
|
|
382
416
|
}
|
|
383
417
|
function filterRecords(records, filters) {
|
|
@@ -422,7 +456,9 @@ function transformRecord(record, selectedAttributeIds) {
|
|
|
422
456
|
authUserId: record.brandappAuthUserId,
|
|
423
457
|
values,
|
|
424
458
|
createdAt: record.createdAt,
|
|
425
|
-
updatedAt: record.updatedAt
|
|
459
|
+
updatedAt: record.updatedAt,
|
|
460
|
+
version: record.version,
|
|
461
|
+
expiresAt: record.expiresAt
|
|
426
462
|
};
|
|
427
463
|
}
|
|
428
464
|
function parseFilters(filtersJson) {
|
|
@@ -455,13 +491,11 @@ function createEavRoutes(store, brandappId) {
|
|
|
455
491
|
});
|
|
456
492
|
app.post("/entities", async (c) => {
|
|
457
493
|
const body = await c.req.json();
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}
|
|
464
|
-
}, 422);
|
|
494
|
+
const existing = store.findFirst(store.entities, (entity) => entity.brandappId === brandappId && entity.name === body.name);
|
|
495
|
+
if (existing) return c.json({
|
|
496
|
+
ok: true,
|
|
497
|
+
data: existing
|
|
498
|
+
});
|
|
465
499
|
const now = store.now();
|
|
466
500
|
const entity = {
|
|
467
501
|
id: store.generateId(),
|
|
@@ -470,7 +504,7 @@ function createEavRoutes(store, brandappId) {
|
|
|
470
504
|
description: body.description ?? null,
|
|
471
505
|
icon: body.icon ?? "📊",
|
|
472
506
|
linkedTo: body.linkedTo ?? "brandapp",
|
|
473
|
-
maxRecords:
|
|
507
|
+
maxRecords: resolveRecordLimit(),
|
|
474
508
|
createdAt: now,
|
|
475
509
|
updatedAt: now
|
|
476
510
|
};
|
|
@@ -724,7 +758,7 @@ function createEavRoutes(store, brandappId) {
|
|
|
724
758
|
}
|
|
725
759
|
}, check.status);
|
|
726
760
|
} else {
|
|
727
|
-
const maxRecords = entity.maxRecords ??
|
|
761
|
+
const maxRecords = entity.maxRecords ?? resolveRecordLimit();
|
|
728
762
|
if (store.count(store.records, (r) => r.entityId === entityId) >= maxRecords) return c.json({
|
|
729
763
|
ok: false,
|
|
730
764
|
error: {
|
|
@@ -740,6 +774,8 @@ function createEavRoutes(store, brandappId) {
|
|
|
740
774
|
brandappAuthUserId: body.authUserId ?? null,
|
|
741
775
|
createdAt: now,
|
|
742
776
|
updatedAt: now,
|
|
777
|
+
version: 1,
|
|
778
|
+
expiresAt: body.expiresAt ? new Date(body.expiresAt) : null,
|
|
743
779
|
values: Object.entries(body.values).map(([attributeId, value]) => ({
|
|
744
780
|
recordId: "",
|
|
745
781
|
attributeId,
|
|
@@ -789,7 +825,7 @@ function createEavRoutes(store, brandappId) {
|
|
|
789
825
|
}
|
|
790
826
|
}, 404);
|
|
791
827
|
const record = store.records.get(recordId);
|
|
792
|
-
if (!record || record.entityId !== entityId) return c.json({
|
|
828
|
+
if (!record || record.entityId !== entityId || !isRecordAlive(record, store.now())) return c.json({
|
|
793
829
|
ok: false,
|
|
794
830
|
error: {
|
|
795
831
|
code: "NOT_FOUND",
|
|
@@ -797,8 +833,49 @@ function createEavRoutes(store, brandappId) {
|
|
|
797
833
|
}
|
|
798
834
|
}, 404);
|
|
799
835
|
const body = await c.req.json();
|
|
800
|
-
|
|
801
|
-
|
|
836
|
+
const values = body.values ?? {};
|
|
837
|
+
const increments = body.increments ?? {};
|
|
838
|
+
const attrsById = new Map(store.getAttributesByEntity(entityId).map((a) => [a.id, a]));
|
|
839
|
+
const incrementErrors = [];
|
|
840
|
+
for (const [attributeId, delta] of Object.entries(increments)) {
|
|
841
|
+
const attr = attrsById.get(attributeId);
|
|
842
|
+
if (!attr) incrementErrors.push({
|
|
843
|
+
field: attributeId,
|
|
844
|
+
message: "존재하지 않는 속성입니다."
|
|
845
|
+
});
|
|
846
|
+
else if (attr.dataType !== "number") incrementErrors.push({
|
|
847
|
+
field: attributeId,
|
|
848
|
+
message: "increment는 number 속성에만 쓸 수 있습니다."
|
|
849
|
+
});
|
|
850
|
+
if (!Number.isFinite(delta)) incrementErrors.push({
|
|
851
|
+
field: attributeId,
|
|
852
|
+
message: "increment 값은 유한한 숫자여야 합니다."
|
|
853
|
+
});
|
|
854
|
+
if (attributeId in values) incrementErrors.push({
|
|
855
|
+
field: attributeId,
|
|
856
|
+
message: "values와 increments에 같은 속성을 넣을 수 없습니다."
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
if (incrementErrors.length > 0) return c.json({
|
|
860
|
+
ok: false,
|
|
861
|
+
error: {
|
|
862
|
+
code: "VALIDATION_ERROR",
|
|
863
|
+
message: `increments 검증 실패: ${incrementErrors.map((e) => `${e.field}: ${e.message}`).join("; ")}`,
|
|
864
|
+
fields: incrementErrors
|
|
865
|
+
}
|
|
866
|
+
}, 422);
|
|
867
|
+
if (body.ifVersion !== void 0 && record.version !== body.ifVersion) return c.json({
|
|
868
|
+
ok: false,
|
|
869
|
+
error: {
|
|
870
|
+
code: "PRECONDITION_FAILED",
|
|
871
|
+
message: `Record version is ${record.version}, expected ${body.ifVersion}`
|
|
872
|
+
}
|
|
873
|
+
}, 412);
|
|
874
|
+
if (!(Object.keys(values).length > 0 || Object.keys(increments).length > 0 || body.expiresAt !== void 0)) return c.json({
|
|
875
|
+
ok: true,
|
|
876
|
+
data: transformRecord(record)
|
|
877
|
+
});
|
|
878
|
+
const setValue = (attributeId, serialized) => {
|
|
802
879
|
const existing = record.values.find((v) => v.attributeId === attributeId);
|
|
803
880
|
if (existing) existing.value = serialized;
|
|
804
881
|
else record.values.push({
|
|
@@ -806,7 +883,15 @@ function createEavRoutes(store, brandappId) {
|
|
|
806
883
|
attributeId,
|
|
807
884
|
value: serialized
|
|
808
885
|
});
|
|
886
|
+
};
|
|
887
|
+
for (const [attributeId, value] of Object.entries(values)) setValue(attributeId, typeof value === "string" ? value : JSON.stringify(value));
|
|
888
|
+
for (const [attributeId, delta] of Object.entries(increments)) {
|
|
889
|
+
const current = record.values.find((v) => v.attributeId === attributeId);
|
|
890
|
+
const parsed = current ? Number(current.value) : 0;
|
|
891
|
+
setValue(attributeId, JSON.stringify((Number.isFinite(parsed) ? parsed : 0) + delta));
|
|
809
892
|
}
|
|
893
|
+
if (body.expiresAt !== void 0) record.expiresAt = body.expiresAt ? new Date(body.expiresAt) : null;
|
|
894
|
+
record.version += 1;
|
|
810
895
|
record.updatedAt = store.now();
|
|
811
896
|
return c.json({
|
|
812
897
|
ok: true,
|
|
@@ -881,7 +966,7 @@ function createEavRoutes(store, brandappId) {
|
|
|
881
966
|
}, check.status);
|
|
882
967
|
}
|
|
883
968
|
} else {
|
|
884
|
-
const maxRecords = entity.maxRecords ??
|
|
969
|
+
const maxRecords = entity.maxRecords ?? resolveRecordLimit();
|
|
885
970
|
if (store.count(store.records, (r) => r.entityId === entityId) + body.records.length > maxRecords) return c.json({
|
|
886
971
|
ok: false,
|
|
887
972
|
error: {
|
|
@@ -899,6 +984,8 @@ function createEavRoutes(store, brandappId) {
|
|
|
899
984
|
brandappAuthUserId: r.authUserId ?? null,
|
|
900
985
|
createdAt: now,
|
|
901
986
|
updatedAt: now,
|
|
987
|
+
version: 1,
|
|
988
|
+
expiresAt: null,
|
|
902
989
|
values: Object.entries(r.values).map(([attributeId, value]) => ({
|
|
903
990
|
recordId: "",
|
|
904
991
|
attributeId,
|
|
@@ -947,6 +1034,7 @@ function createEavRoutes(store, brandappId) {
|
|
|
947
1034
|
});
|
|
948
1035
|
}
|
|
949
1036
|
record.updatedAt = store.now();
|
|
1037
|
+
record.version += 1;
|
|
950
1038
|
results.push(transformRecord(record));
|
|
951
1039
|
}
|
|
952
1040
|
return c.json({
|
|
@@ -1022,6 +1110,7 @@ function createEavRoutes(store, brandappId) {
|
|
|
1022
1110
|
});
|
|
1023
1111
|
}
|
|
1024
1112
|
matched.updatedAt = store.now();
|
|
1113
|
+
matched.version += 1;
|
|
1025
1114
|
return c.json({
|
|
1026
1115
|
ok: true,
|
|
1027
1116
|
data: {
|
|
@@ -1031,7 +1120,7 @@ function createEavRoutes(store, brandappId) {
|
|
|
1031
1120
|
});
|
|
1032
1121
|
}
|
|
1033
1122
|
if (!isAuthUserLinked) {
|
|
1034
|
-
const maxRecords = entity.maxRecords ??
|
|
1123
|
+
const maxRecords = entity.maxRecords ?? resolveRecordLimit();
|
|
1035
1124
|
if (store.count(store.records, (r) => r.entityId === entityId) >= maxRecords) return c.json({
|
|
1036
1125
|
ok: false,
|
|
1037
1126
|
error: {
|
|
@@ -1047,6 +1136,8 @@ function createEavRoutes(store, brandappId) {
|
|
|
1047
1136
|
brandappAuthUserId: body.authUserId ?? null,
|
|
1048
1137
|
createdAt: now,
|
|
1049
1138
|
updatedAt: now,
|
|
1139
|
+
version: 1,
|
|
1140
|
+
expiresAt: null,
|
|
1050
1141
|
values: Object.entries(body.values).map(([attributeId, value]) => ({
|
|
1051
1142
|
recordId: "",
|
|
1052
1143
|
attributeId,
|
|
@@ -3091,6 +3182,8 @@ async function createDevServer(options = {}) {
|
|
|
3091
3182
|
brandappAuthUserId: r.authUserId ?? null,
|
|
3092
3183
|
createdAt: now,
|
|
3093
3184
|
updatedAt: now,
|
|
3185
|
+
version: 1,
|
|
3186
|
+
expiresAt: null,
|
|
3094
3187
|
values: buildSeedValues("", r.values)
|
|
3095
3188
|
};
|
|
3096
3189
|
record.values.forEach((v) => v.recordId = record.id);
|
package/dist/eav/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { c as DuplicateAuthUserError, f as LimitExceededError, n as AuthUserNotFoundError, r as AuthUserRecordExistsError } from "../errors-
|
|
3
|
-
import { i as TypedEavRecord, n as createReoptEavClient, r as EntityClient, t as ReoptEavClient } from "../client-
|
|
1
|
+
import { A as ListRecordsQuery, C as EavAttribute, D as EavRecord, E as EavEntity, F as UpsertRecordInput, I as UpsertRecordResult, M as UpdateAttributeInput, N as UpdateEntityInput, O as EavSchemaLinkedTo, P as UpdateRecordInput, 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-D28P8iwm.js";
|
|
2
|
+
import { c as DuplicateAuthUserError, f as LimitExceededError, n as AuthUserNotFoundError, r as AuthUserRecordExistsError } from "../errors-U3TsyWVq.js";
|
|
3
|
+
import { i as TypedEavRecord, n as createReoptEavClient, r as EntityClient, t as ReoptEavClient } from "../client-DjgoTlfv.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
|
|
@@ -134,6 +134,15 @@ declare class FilterExpression {
|
|
|
134
134
|
eq(value: unknown): AttributeFilter;
|
|
135
135
|
/** 값이 다른 레코드 */
|
|
136
136
|
neq(value: unknown): AttributeFilter;
|
|
137
|
+
/**
|
|
138
|
+
* 값이 목록 안에 있는 레코드 (`eq`의 집합 확장)
|
|
139
|
+
*
|
|
140
|
+
* 🔴 빈 목록은 서버가 400으로 거절한다 — `[]`를 "조건 없음"으로 읽으면 필터를 건
|
|
141
|
+
* 줄 아는 호출부에 무필터 결과가 간다. 제외가 없으면 필터를 **빼야** 한다.
|
|
142
|
+
*/
|
|
143
|
+
in(values: readonly AttributeFilterListValue[]): AttributeFilter;
|
|
144
|
+
/** 값이 목록에 없는 레코드 (`neq`의 집합 확장 — 값이 없는 레코드도 포함된다) */
|
|
145
|
+
notIn(values: readonly AttributeFilterListValue[]): AttributeFilter;
|
|
137
146
|
/** 값에 문자열을 포함하는 레코드 */
|
|
138
147
|
contains(value: string): AttributeFilter;
|
|
139
148
|
/** 값이 큰 레코드 (숫자) */
|
|
@@ -182,5 +191,5 @@ declare function where(attributeNameOrId: string): FilterExpression;
|
|
|
182
191
|
*/
|
|
183
192
|
declare function createFilterBuilder<T extends Record<string, string>>(attributeIdMap: T): (name: keyof T & string) => FilterExpression;
|
|
184
193
|
//#endregion
|
|
185
|
-
export { type AttributeFilter, type AttributeFilterOperator, AuthUserNotFoundError, AuthUserRecordExistsError, type BulkUpdateItem, type CanonicalEavField, type CanonicalEavSchema, type CountRecordsQuery, type CreateAttributeInput, type CreateEntityInput, type CreateRecordInput, type DeleteWhereInput, DuplicateAuthUserError, type EavAttribute, type EavAttributeOption, type EavDataType, type EavEntity, type EavRecord, type EavSchemaLinkedTo, type EavValidation, type EntityClient, FilterExpression, LimitExceededError, type ListRecordsQuery, type PaginatedResponse, type ReoptEavClient, type ReoptSDKConfig, type TypedEavRecord, type UpdateAttributeInput, type UpdateEntityInput, type UpdateRecordInput, type UpsertRecordInput, type UpsertRecordResult, type VerifyEavSchemaInput, type VerifyEavSchemaResult, canonicalizeEavSchemas, collectAll, computeEavSchemaHash, createFilterBuilder, createReoptEavClient, hashCanonicalString, verifyEavSchema, where };
|
|
194
|
+
export { ATTRIBUTE_FILTER_LIST_MAX, ATTRIBUTE_FILTER_OPERATORS, type AttributeFilter, type AttributeFilterListValue, type AttributeFilterOperator, AuthUserNotFoundError, AuthUserRecordExistsError, type BulkUpdateItem, type CanonicalEavField, type CanonicalEavSchema, type CountRecordsQuery, type CreateAttributeInput, type CreateEntityInput, type CreateRecordInput, type DeleteWhereInput, DuplicateAuthUserError, type EavAttribute, type EavAttributeOption, type EavDataType, type EavEntity, type EavRecord, type EavSchemaLinkedTo, type EavValidation, type EntityClient, FilterExpression, LimitExceededError, type ListRecordsQuery, type PaginatedResponse, type ReoptEavClient, type ReoptSDKConfig, type TypedEavRecord, type UpdateAttributeInput, type UpdateEntityInput, type UpdateRecordInput, type UpsertRecordInput, type UpsertRecordResult, type VerifyEavSchemaInput, type VerifyEavSchemaResult, canonicalizeEavSchemas, collectAll, computeEavSchemaHash, createFilterBuilder, createReoptEavClient, hashCanonicalString, verifyEavSchema, where };
|
|
186
195
|
//# sourceMappingURL=index.d.ts.map
|
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-
|
|
2
|
-
import { t as createReoptEavClient } from "../client-
|
|
1
|
+
import { c as AuthUserNotFoundError, g as LimitExceededError, l as AuthUserRecordExistsError, m as DuplicateAuthUserError } from "../config-D8dSL6OQ.js";
|
|
2
|
+
import { t as createReoptEavClient } from "../client-CaWHvclV.js";
|
|
3
3
|
|
|
4
4
|
//#region src/eav/verify.ts
|
|
5
5
|
async function verifyEavSchema(input) {
|
|
@@ -63,6 +63,36 @@ async function computeEavSchemaHash(schemas) {
|
|
|
63
63
|
return hashCanonicalString(canonicalizeEavSchemas(schemas));
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/eav/types.ts
|
|
68
|
+
/**
|
|
69
|
+
* Every filter operator the EAV record endpoints accept.
|
|
70
|
+
*
|
|
71
|
+
* Exported as a runtime value on purpose: the type alone cannot be compared
|
|
72
|
+
* against anything at test time, and this vocabulary is a copy — the server
|
|
73
|
+
* owns it in `apps/web/server/hono/routes/brandapp-eav-schemas.ts` and this
|
|
74
|
+
* package cannot import across the deployment boundary. The copy is held to
|
|
75
|
+
* the original by `apps/web/server/mcp/__tests__/eav-filter-operator-parity.test.ts`,
|
|
76
|
+
* which reads *this* array rather than a hand-written list.
|
|
77
|
+
*/
|
|
78
|
+
const ATTRIBUTE_FILTER_OPERATORS = [
|
|
79
|
+
"eq",
|
|
80
|
+
"neq",
|
|
81
|
+
"contains",
|
|
82
|
+
"gt",
|
|
83
|
+
"lt",
|
|
84
|
+
"gte",
|
|
85
|
+
"lte",
|
|
86
|
+
"is_null",
|
|
87
|
+
"is_not_null",
|
|
88
|
+
"after",
|
|
89
|
+
"before",
|
|
90
|
+
"in",
|
|
91
|
+
"not_in"
|
|
92
|
+
];
|
|
93
|
+
/** Maximum number of entries in one `in` / `not_in` list (server-enforced). */
|
|
94
|
+
const ATTRIBUTE_FILTER_LIST_MAX = 100;
|
|
95
|
+
|
|
66
96
|
//#endregion
|
|
67
97
|
//#region src/eav/helpers.ts
|
|
68
98
|
/**
|
|
@@ -101,6 +131,19 @@ var FilterExpression = class {
|
|
|
101
131
|
neq(value) {
|
|
102
132
|
return this.make("neq", value);
|
|
103
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* 값이 목록 안에 있는 레코드 (`eq`의 집합 확장)
|
|
136
|
+
*
|
|
137
|
+
* 🔴 빈 목록은 서버가 400으로 거절한다 — `[]`를 "조건 없음"으로 읽으면 필터를 건
|
|
138
|
+
* 줄 아는 호출부에 무필터 결과가 간다. 제외가 없으면 필터를 **빼야** 한다.
|
|
139
|
+
*/
|
|
140
|
+
in(values) {
|
|
141
|
+
return this.make("in", [...values]);
|
|
142
|
+
}
|
|
143
|
+
/** 값이 목록에 없는 레코드 (`neq`의 집합 확장 — 값이 없는 레코드도 포함된다) */
|
|
144
|
+
notIn(values) {
|
|
145
|
+
return this.make("not_in", [...values]);
|
|
146
|
+
}
|
|
104
147
|
/** 값에 문자열을 포함하는 레코드 */
|
|
105
148
|
contains(value) {
|
|
106
149
|
return this.make("contains", value);
|
|
@@ -176,5 +219,5 @@ function createFilterBuilder(attributeIdMap) {
|
|
|
176
219
|
}
|
|
177
220
|
|
|
178
221
|
//#endregion
|
|
179
|
-
export { AuthUserNotFoundError, AuthUserRecordExistsError, DuplicateAuthUserError, FilterExpression, LimitExceededError, canonicalizeEavSchemas, collectAll, computeEavSchemaHash, createFilterBuilder, createReoptEavClient, hashCanonicalString, verifyEavSchema, where };
|
|
222
|
+
export { ATTRIBUTE_FILTER_LIST_MAX, ATTRIBUTE_FILTER_OPERATORS, AuthUserNotFoundError, AuthUserRecordExistsError, DuplicateAuthUserError, FilterExpression, LimitExceededError, canonicalizeEavSchemas, collectAll, computeEavSchemaHash, createFilterBuilder, createReoptEavClient, hashCanonicalString, verifyEavSchema, where };
|
|
180
223
|
//# sourceMappingURL=index.js.map
|
package/dist/eav/migrate.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as AttributeDef, s as EntityDef } from "../config-
|
|
2
|
-
import { t as ReoptEavClient } from "../client-
|
|
1
|
+
import { o as AttributeDef, s as EntityDef } from "../config-D28P8iwm.js";
|
|
2
|
+
import { t as ReoptEavClient } from "../client-DjgoTlfv.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`.
|
|
@@ -96,7 +96,7 @@ type MigrationRunResult = {
|
|
|
96
96
|
* Mirrors `apps/web/server/hono/routes/brandapp-migrations-schemas.ts`'s
|
|
97
97
|
* `MigrationOperation`. Sent to `POST /v1/brandapp/{id}/migrations/apply`
|
|
98
98
|
* where the server applies the whole array inside a single
|
|
99
|
-
*
|
|
99
|
+
* server-side database transaction (Phase A.5 atomicity, RFC-0005 ADR-2).
|
|
100
100
|
*
|
|
101
101
|
* `records.*` calls are NOT represented here — they execute immediately and
|
|
102
102
|
* outside the transaction.
|
|
@@ -218,7 +218,7 @@ type CollectMigrationResult = {
|
|
|
218
218
|
* Run a migration's `up`/`down` function with a buffering schema client so
|
|
219
219
|
* the consumer can apply the whole operation set atomically (e.g. via the
|
|
220
220
|
* server's `POST /v1/brandapp/{id}/migrations/apply` route, which wraps the
|
|
221
|
-
* whole array in
|
|
221
|
+
* whole array in one server-side database transaction).
|
|
222
222
|
*
|
|
223
223
|
* Key differences vs. `runMigration`:
|
|
224
224
|
* - **Schema ops are buffered, not sent.** The returned `operations` array
|
package/dist/eav/migrate.js
CHANGED
|
@@ -168,7 +168,7 @@ async function runMigration(eav, migration, opts) {
|
|
|
168
168
|
* Run a migration's `up`/`down` function with a buffering schema client so
|
|
169
169
|
* the consumer can apply the whole operation set atomically (e.g. via the
|
|
170
170
|
* server's `POST /v1/brandapp/{id}/migrations/apply` route, which wraps the
|
|
171
|
-
* whole array in
|
|
171
|
+
* whole array in one server-side database transaction).
|
|
172
172
|
*
|
|
173
173
|
* Key differences vs. `runMigration`:
|
|
174
174
|
* - **Schema ops are buffered, not sent.** The returned `operations` array
|
package/dist/eav/schema.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { t as ReoptEavClient } from "../client-
|
|
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-D28P8iwm.js";
|
|
2
|
+
import { t as ReoptEavClient } from "../client-DjgoTlfv.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>;
|
|
@@ -37,7 +37,7 @@ declare class RateLimitError extends ReoptSDKError {
|
|
|
37
37
|
declare class ServerError extends ReoptSDKError {
|
|
38
38
|
constructor(message?: string, context?: ReoptSDKErrorContext);
|
|
39
39
|
}
|
|
40
|
-
/** AI
|
|
40
|
+
/** AI 사용량 잔액 부족 (HTTP 402). */
|
|
41
41
|
declare class CreditLimitError extends ReoptSDKError {
|
|
42
42
|
constructor(message?: string, context?: ReoptSDKErrorContext, code?: string);
|
|
43
43
|
}
|
|
@@ -77,6 +77,13 @@ declare class DuplicateAuthUserError extends ConflictError {
|
|
|
77
77
|
constructor(message?: string, context?: ReoptSDKErrorContext);
|
|
78
78
|
}
|
|
79
79
|
/** 참조한 brandappAuthUser가 이 brandapp에 존재하지 않음. status는 호출 경로에 따라 400 또는 422. */
|
|
80
|
+
/**
|
|
81
|
+
* 412 — `update(..., { ifVersion })`의 version이 현재와 다르다. 레코드를 다시 읽어
|
|
82
|
+
* 새 `version`으로 재시도할 것(CAS 루프).
|
|
83
|
+
*/
|
|
84
|
+
declare class PreconditionFailedError extends ReoptSDKError {
|
|
85
|
+
constructor(message: string, context?: ReoptSDKErrorContext);
|
|
86
|
+
}
|
|
80
87
|
declare class AuthUserNotFoundError extends ReoptSDKError {
|
|
81
88
|
constructor(message?: string, status?: 400 | 422, context?: ReoptSDKErrorContext);
|
|
82
89
|
}
|
|
@@ -178,5 +185,5 @@ declare function isModelAccessError(error: unknown): error is ModelAccessError;
|
|
|
178
185
|
*/
|
|
179
186
|
declare function mapHttpStatusToError(status: number, code: string | undefined, message: string | undefined, ctx?: ReoptSDKErrorContext, fieldErrors?: FieldError[]): ReoptSDKError;
|
|
180
187
|
//#endregion
|
|
181
|
-
export {
|
|
182
|
-
//# sourceMappingURL=errors-
|
|
188
|
+
export { isCreditLimitError as C, isValidationError as D, isRequiredTermsError as E, mapHttpStatusToError as O, ValidationError as S, isReoptSDKError as T, RateLimitError as _, ConflictError as a, RequiredTermsError as b, DuplicateAuthUserError as c, ForbiddenError as d, LimitExceededError as f, PreconditionFailedError as g, NotFoundError as h, BadRequestError as i, ErrorDiagnostic as l, ModelNotFoundError as m, AuthUserNotFoundError as n, ContentFilterError as o, ModelAccessError as p, AuthUserRecordExistsError as r, CreditLimitError as s, AuthError as t, FieldError as u, ReoptSDKError as v, isModelAccessError as w, ServerError as x, ReoptSDKErrorContext as y };
|
|
189
|
+
//# sourceMappingURL=errors-U3TsyWVq.d.ts.map
|
package/dist/feedback/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as CreateFeedbackResult, c as FeedbackListMeta, d as FeedbackReplyAuthor, f as FeedbackStatus, i as CreateFeedbackReplyResult, l as FeedbackListResult, m as RateFeedbackReplyResult, n as createReoptFeedbackClient, o as Feedback, p as ListFeedbackQuery, r as CreateFeedbackInput, s as FeedbackDetail, t as ReoptFeedbackClient, u as FeedbackReply } from "../client-
|
|
1
|
+
import { a as CreateFeedbackResult, c as FeedbackListMeta, d as FeedbackReplyAuthor, f as FeedbackStatus, i as CreateFeedbackReplyResult, l as FeedbackListResult, m as RateFeedbackReplyResult, n as createReoptFeedbackClient, o as Feedback, p as ListFeedbackQuery, r as CreateFeedbackInput, s as FeedbackDetail, t as ReoptFeedbackClient, u as FeedbackReply } from "../client-B4CiEei5.js";
|
|
2
2
|
export { type CreateFeedbackInput, type CreateFeedbackReplyResult, type CreateFeedbackResult, type Feedback, type FeedbackDetail, type FeedbackListMeta, type FeedbackListResult, type FeedbackReply, type FeedbackReplyAuthor, type FeedbackStatus, type ListFeedbackQuery, type RateFeedbackReplyResult, ReoptFeedbackClient, createReoptFeedbackClient };
|
package/dist/feedback/index.js
CHANGED
package/dist/files/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as FileListQuery, c as FolderInfo, d as UpdateFolderInput, f as UploadOptions, i as FileInfo, l as FolderListQuery, n as createReoptFileClient, o as FileListResponse, r as CreateFolderInput, s as FileUsageInfo, t as ReoptFileClient, u as UpdateFileInput } from "../client-
|
|
1
|
+
import { a as FileListQuery, c as FolderInfo, d as UpdateFolderInput, f as UploadOptions, i as FileInfo, l as FolderListQuery, n as createReoptFileClient, o as FileListResponse, r as CreateFolderInput, s as FileUsageInfo, t as ReoptFileClient, u as UpdateFileInput } from "../client-BOEyVc8V.js";
|
|
2
2
|
//#region src/files/helpers.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* 이미지 URL 헬퍼 — Next.js `<Image>`와 결합해 사용.
|
package/dist/files/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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-D8dSL6OQ.js";
|
|
2
2
|
import { t as createAuthHeader } from "./encoding-Bwfm3iaE.js";
|
|
3
3
|
|
|
4
4
|
//#region src/core/debug.ts
|
|
@@ -383,4 +383,4 @@ function parseFieldErrors(body) {
|
|
|
383
383
|
|
|
384
384
|
//#endregion
|
|
385
385
|
export { parseFieldErrors as n, BaseHttpClient as t };
|
|
386
|
-
//# sourceMappingURL=http-client-
|
|
386
|
+
//# sourceMappingURL=http-client-0Sp8wQGQ.js.map
|