@reopt-ai/brandapp-sdk 4.2.0 → 4.4.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 +31 -2
- package/README.md +1 -1
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.js +1 -1
- package/dist/ai-provider/index.js +77 -66
- 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 +2 -2
- package/dist/better-auth/index.js +2 -2
- package/dist/{client-D5F6-YYU.d.ts → client-7I-mz3Dw.d.ts} +2 -2
- package/dist/{client-bXAnGNzC.d.ts → client-BSW0Ncjj.d.ts} +2 -2
- package/dist/{client-CNPfjmT0.d.ts → client-Bfutv3LK.d.ts} +2 -2
- package/dist/{client-ClX0it9Z.js → client-C4sDbXto.js} +70 -6
- package/dist/{client-DjgoTlfv.d.ts → client-C6OXGMMV.d.ts} +2 -2
- package/dist/{client-CeYaCY1n.d.ts → client-COKDtHO9.d.ts} +7 -5
- package/dist/{client-BOEyVc8V.d.ts → client-CniCGdmi.d.ts} +2 -2
- package/dist/{client-C1zORyWz.js → client-CuM8MNS5.js} +2 -2
- package/dist/{client-DEY11EBB.d.ts → client-D1AFtJRw.d.ts} +10 -10
- package/dist/{client-DY62Nb7m.js → client-DYkDNPyN.js} +2 -2
- package/dist/{client-C5CsGtWK.js → client-D_6WdWsc.js} +3 -3
- package/dist/{client-DYammrtw.d.ts → client-Dmvtr1nS.d.ts} +2 -2
- package/dist/{client-oDJVL5JF.js → client-DsM84EZZ.js} +3 -3
- package/dist/{client-DfGEiRKb.js → client-DuATTvcr.js} +2 -2
- package/dist/{client-C3hlUyaZ.js → client-EG1p7FL0.js} +2 -2
- package/dist/{client-CRim5LCH.d.ts → client-IUSZDJio.d.ts} +2 -2
- package/dist/{client-DR5Eb36i.js → client-afAv7Ebi.js} +16 -9
- package/dist/{client-Dd1QpCUq.js → client-mD6o-qVl.js} +2 -2
- package/dist/{client-B_7XihyW.js → client-s2uJ3OML.js} +2 -2
- package/dist/{client-BBxhqs8l.d.ts → client-yKeRJnIB.d.ts} +2 -2
- package/dist/cms/index.d.ts +1 -1
- package/dist/cms/index.js +1 -1
- package/dist/{config-BrJAy95F.js → config-C_OFYAgP.js} +5 -5
- package/dist/{config-D28P8iwm.d.ts → config-D3SblxWt.d.ts} +19 -2
- package/dist/dev/index.js +15 -5
- package/dist/eav/index.d.ts +4 -4
- package/dist/eav/index.js +3 -33
- package/dist/eav/migrate.d.ts +2 -2
- package/dist/eav/schema.d.ts +2 -2
- package/dist/{errors-BnIRV-Px.d.ts → errors-U3TsyWVq.d.ts} +2 -2
- 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-Dw_U7Wgx.js → http-client-BUbFBOvG.js} +2 -2
- package/dist/{index-CBPdczmp.d.ts → index-BnAYxnwq.d.ts} +12 -12
- package/dist/index.d.ts +5 -5
- package/dist/index.js +12 -12
- 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-l08AoqXP.js → query-BkdTSuB5.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 +1 -1
- package/docs/api-reference.md +20 -12
- package/docs/cms.md +3 -1
- package/docs/dev-server.md +1 -1
- package/docs/errors.md +16 -16
- package/package.json +1 -1
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-
|
|
2
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
3
|
-
import { n as createReoptAiClient } from "./client-
|
|
4
|
-
import { n as createReoptAuthClient } from "./client-
|
|
5
|
-
import { t as createReoptCmsClient } from "./client-
|
|
6
|
-
import { t as createReoptEavClient } from "./client-
|
|
7
|
-
import { n as createReoptFeedbackClient } from "./client-
|
|
8
|
-
import { n as createReoptFileClient } from "./client-
|
|
9
|
-
import { n as createReoptAnalyticsClient } from "./client-
|
|
10
|
-
import { n as createReoptPlansClient } from "./client-
|
|
11
|
-
import { n as createReoptPushClient } from "./client-
|
|
12
|
-
import { n as createReoptTermsClient } from "./client-
|
|
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-C_OFYAgP.js";
|
|
2
|
+
import { t as BaseHttpClient } from "./http-client-BUbFBOvG.js";
|
|
3
|
+
import { n as createReoptAiClient } from "./client-afAv7Ebi.js";
|
|
4
|
+
import { n as createReoptAuthClient } from "./client-DuATTvcr.js";
|
|
5
|
+
import { t as createReoptCmsClient } from "./client-D_6WdWsc.js";
|
|
6
|
+
import { t as createReoptEavClient } from "./client-C4sDbXto.js";
|
|
7
|
+
import { n as createReoptFeedbackClient } from "./client-DYkDNPyN.js";
|
|
8
|
+
import { n as createReoptFileClient } from "./client-DsM84EZZ.js";
|
|
9
|
+
import { n as createReoptAnalyticsClient } from "./client-EG1p7FL0.js";
|
|
10
|
+
import { n as createReoptPlansClient } from "./client-mD6o-qVl.js";
|
|
11
|
+
import { n as createReoptPushClient } from "./client-CuM8MNS5.js";
|
|
12
|
+
import { n as createReoptTermsClient } from "./client-s2uJ3OML.js";
|
|
13
13
|
|
|
14
14
|
//#region src/singleton.ts
|
|
15
15
|
let _instance;
|
package/dist/logout/index.d.ts
CHANGED
package/dist/logout/index.js
CHANGED
package/dist/plans/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as CheckoutStatus, c as MeterPricingMode, d as PlanInterval, f as PlanMeter, i as CheckoutSession, l as Plan, m as PlanRequiredTerms, n as createReoptPlansClient, o as CreateCheckoutInput, p as PlanMeterTier, r as CancelSubscriptionResult, s as CurrentPlan, t as ReoptPlansClient, u as PlanBillingModel } from "../client-
|
|
1
|
+
import { a as CheckoutStatus, c as MeterPricingMode, d as PlanInterval, f as PlanMeter, i as CheckoutSession, l as Plan, m as PlanRequiredTerms, n as createReoptPlansClient, o as CreateCheckoutInput, p as PlanMeterTier, r as CancelSubscriptionResult, s as CurrentPlan, t as ReoptPlansClient, u as PlanBillingModel } from "../client-IUSZDJio.js";
|
|
2
2
|
export { type CancelSubscriptionResult, type CheckoutSession, type CheckoutStatus, type CreateCheckoutInput, type CurrentPlan, type MeterPricingMode, type Plan, type PlanBillingModel, type PlanInterval, type PlanMeter, type PlanMeterTier, type PlanRequiredTerms, ReoptPlansClient, createReoptPlansClient };
|
package/dist/plans/index.js
CHANGED
package/dist/push/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as RegisterPushTokenInput, c as UnregisterPushTokenInput, i as PushProvider, l as UnregisterPushTokenResult, n as createReoptPushClient, o as RegisterPushTokenResult, r as PushPlatform, s as RegisteredPushDevice, t as ReoptPushClient } from "../client-
|
|
1
|
+
import { a as RegisterPushTokenInput, c as UnregisterPushTokenInput, i as PushProvider, l as UnregisterPushTokenResult, n as createReoptPushClient, o as RegisterPushTokenResult, r as PushPlatform, s as RegisteredPushDevice, t as ReoptPushClient } from "../client-BSW0Ncjj.js";
|
|
2
2
|
export { type PushPlatform, type PushProvider, type RegisterPushTokenInput, type RegisterPushTokenResult, type RegisteredPushDevice, ReoptPushClient, type UnregisterPushTokenInput, type UnregisterPushTokenResult, createReoptPushClient };
|
package/dist/push/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as ReoptSDKError } from "./config-
|
|
1
|
+
import { S as ReoptSDKError } from "./config-C_OFYAgP.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-
|
|
35
|
+
//# sourceMappingURL=query-BkdTSuB5.js.map
|
package/dist/react/hooks.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as ListRecordsQuery, C as EavAttribute, D as EavRecord, E as EavEntity, F as
|
|
2
|
-
import { a as CompletionOptions, f as ModelInfo, l as ImageGenerateOptions, o as CompletionResult, p as StreamDoneData, r as AgentInfo, s as CreditInfo, u as ImageGenerateResult } from "../client-
|
|
3
|
-
import { v as ReoptSDKError } from "../errors-
|
|
1
|
+
import { A as ListRecordsQuery, C as EavAttribute, D as EavRecord, E as EavEntity, F as UpdateRecordInput, I as UpsertRecordInput, L as UpsertRecordResult, S as DeleteWhereInput, _ as BulkUpdateItem, j as PaginatedResponse, x as CreateRecordInput } from "../config-D3SblxWt.js";
|
|
2
|
+
import { a as CompletionOptions, f as ModelInfo, l as ImageGenerateOptions, o as CompletionResult, p as StreamDoneData, r as AgentInfo, s as CreditInfo, u as ImageGenerateResult } from "../client-D1AFtJRw.js";
|
|
3
|
+
import { v as ReoptSDKError } from "../errors-U3TsyWVq.js";
|
|
4
4
|
import { a as ListTagsQuery, c as PostGroup, d as Tag, i as ListPostsQuery, o as Post, r as ListPostGroupsQuery, s as PostDetail, t as CmsPaginatedResponse } from "../types-BXDcoJHG.js";
|
|
5
|
-
import { a as FileListQuery, c as FolderInfo, d as UpdateFolderInput, f as UploadOptions, i as FileInfo, l as FolderListQuery, o as FileListResponse, r as CreateFolderInput, s as FileUsageInfo, u as UpdateFileInput } from "../client-
|
|
6
|
-
import { t as ReoptSDK } from "../index-
|
|
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-CniCGdmi.js";
|
|
6
|
+
import { t as ReoptSDK } from "../index-BnAYxnwq.js";
|
|
7
7
|
import { UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
8
8
|
//#region src/react/use-ai-stream.d.ts
|
|
9
9
|
type UseAiStreamOptions = {
|
|
@@ -200,7 +200,7 @@ declare function useBulkDeleteRecords(sdk: ReoptSDK, entityId: string, options?:
|
|
|
200
200
|
*/
|
|
201
201
|
declare function useDeleteRecordsWhere(sdk: ReoptSDK, entityId: string, options?: UseMutationOptions<number, Error, DeleteWhereInput>): UseMutationResult<number, Error, DeleteWhereInput>;
|
|
202
202
|
/**
|
|
203
|
-
* BrandApp AI
|
|
203
|
+
* BrandApp AI 사용량 잔액 조회
|
|
204
204
|
*
|
|
205
205
|
* @example
|
|
206
206
|
* ```tsx
|
package/dist/react/hooks.js
CHANGED
package/dist/terms/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as CreateConsentsResult, c as TermsJurisdiction, d as TermsVersion, f as WithdrawConsentResult, i as CreateConsentsRequest, l as TermsListResponse, n as ConsentRecord, o as ListTermsOptions, r as ConsentStatus, s as TermsItem, t as ConsentInput, u as TermsType } from "../types-C69OzBn6.js";
|
|
2
|
-
import { n as createReoptTermsClient, t as ReoptTermsClient } from "../client-
|
|
2
|
+
import { n as createReoptTermsClient, t as ReoptTermsClient } from "../client-yKeRJnIB.js";
|
|
3
3
|
export { type ConsentInput, type ConsentRecord, type ConsentStatus, type CreateConsentsRequest, type CreateConsentsResult, type ListTermsOptions, ReoptTermsClient, type TermsItem, type TermsJurisdiction, type TermsListResponse, type TermsType, type TermsVersion, type WithdrawConsentResult, createReoptTermsClient };
|
package/dist/terms/index.js
CHANGED
package/dist/testing/index.d.ts
CHANGED
|
@@ -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-C6fyJTud.js";
|
|
2
|
-
import { t as ReoptSDK } from "../index-
|
|
2
|
+
import { t as ReoptSDK } from "../index-BnAYxnwq.js";
|
|
3
3
|
//#region src/testing/index.d.ts
|
|
4
4
|
type TestSDKOptions = {
|
|
5
5
|
/** EAV schema to seed entities and attributes */
|
package/docs/api-reference.md
CHANGED
|
@@ -314,8 +314,8 @@ await generateText({
|
|
|
314
314
|
});
|
|
315
315
|
|
|
316
316
|
// Image generation via AI SDK
|
|
317
|
-
import {
|
|
318
|
-
const { image } = await
|
|
317
|
+
import { generateImage } from "ai";
|
|
318
|
+
const { image } = await generateImage({
|
|
319
319
|
model: brandapp.imageModel("google/gemini-2.5-flash-image"),
|
|
320
320
|
prompt: "A brand banner",
|
|
321
321
|
providerOptions: { brandapp: { style: "minimalist", aspectRatio: "16:9" } },
|
|
@@ -329,17 +329,18 @@ BrandApp AI API는 멀티테넌트 안전을 위해 **텍스트·이미지 표
|
|
|
329
329
|
**지원**
|
|
330
330
|
|
|
331
331
|
- `generateText()`, `streamText()` — 텍스트 생성
|
|
332
|
-
- `
|
|
332
|
+
- `generateImage()` — 이미지 생성 (`brandapp.imageModel(...)`)
|
|
333
333
|
- `providerMetadata.brandapp` — `creditCost` / `creditsRemaining` / `responseId`
|
|
334
334
|
- `providerOptions.brandapp` — `customerId` / `style` / `negativePrompt` / `aspectRatio`
|
|
335
335
|
- `finishReason` — 서버가 보고하면 정확히 매핑(미보고 시 `stop`)
|
|
336
336
|
|
|
337
|
-
**미지원**
|
|
337
|
+
**미지원**
|
|
338
338
|
|
|
339
|
-
- tool/function calling — `tools
|
|
340
|
-
- 구조화 출력 —
|
|
341
|
-
- 비전·파일 입력 —
|
|
342
|
-
-
|
|
339
|
+
- tool/function calling — `tools` 또는 필수 `toolChoice` 요청은 HTTP 호출 전에 `UnsupportedFunctionalityError`
|
|
340
|
+
- 구조화 출력 — JSON response format 요청은 HTTP 호출 전에 `UnsupportedFunctionalityError`
|
|
341
|
+
- 비전·파일 입력 — 사용자·assistant·도구 결과의 이미지/파일은 HTTP 호출 전에 `UnsupportedFunctionalityError`
|
|
342
|
+
- 이미지 편집·참조·마스크 — 이미지 모델의 `files` / `mask` 요청도 HTTP 호출 전에 `UnsupportedFunctionalityError`
|
|
343
|
+
- `topP` / `topK` / `frequencyPenalty` / `presencePenalty` / `stopSequences` / `seed` — warning 후 생략
|
|
343
344
|
- 임베딩·음성·전사 모델 — `brandapp.embeddingModel(...)` 등은 `NoSuchModelError`
|
|
344
345
|
|
|
345
346
|
**에러** — provider는 `APICallError`(AI SDK 표준)를 던진다. `error.isRetryable`로 재시도
|
|
@@ -392,6 +393,8 @@ await sdk.eav.records.create(entityId, {
|
|
|
392
393
|
expiresAt: new Date(Date.now() + 60_000).toISOString(),
|
|
393
394
|
});
|
|
394
395
|
await sdk.eav.records.update(entityId, recordId, { expiresAt: null }); // TTL 해제
|
|
396
|
+
// ⚠️ expiresAt는 클라이언트가 계산한 절대 시각이다 — 서버 수신 시각 기준이 아니다.
|
|
397
|
+
// 콜드스타트 create가 수 초 걸릴 수 있으니(실측 3.7초) 초 단위 짧은 TTL은 그만큼 여유를 둘 것.
|
|
395
398
|
```
|
|
396
399
|
|
|
397
400
|
### 한도 (production API 기준, 2026-08-30)
|
|
@@ -402,7 +405,7 @@ await sdk.eav.records.update(entityId, recordId, { expiresAt: null }); // TTL
|
|
|
402
405
|
| 속성/엔티티 | 100 | `LIMIT_EXCEEDED_ATTRIBUTES` |
|
|
403
406
|
| 레코드/엔티티 | 10,000 기본 (운영자 `BRANDAPP_EAV_MAX_RECORDS_PER_ENTITY`로 인상) — 만료 행 제외 | `LIMIT_EXCEEDED_RECORDS` (422) |
|
|
404
407
|
| 인메모리 후보 상한 | 10,000행 — 필터가 SQL로 못 내려가는 요청(`neq`/`not_in`/`after`/`before`, 커스텀 속성 정렬)만 해당 | `QUERY_TOO_BROAD` (422) |
|
|
405
|
-
| `list` limit | 최대 100, 기본 50
|
|
408
|
+
| `list` limit | 최대 100, 기본 50 — SDK가 요청 전에 거절(`RECORDS_PAGE_LIMIT_MAX`), 여러 페이지는 `listAll()` | 400 |
|
|
406
409
|
| bulk create/update/delete | 호출당 100건 | 400 |
|
|
407
410
|
| 레코드 값 직렬화 | 128KB/레코드 | `VALIDATION_ERROR` (422) |
|
|
408
411
|
| 엔티티·속성 name/label | 100자, description 500자 | 400 |
|
|
@@ -412,7 +415,9 @@ await sdk.eav.records.update(entityId, recordId, { expiresAt: null }); // TTL
|
|
|
412
415
|
|
|
413
416
|
```typescript
|
|
414
417
|
|
|
415
|
-
// Pagination (async generator)
|
|
418
|
+
// Pagination (async generator) — limit은 페이지 크기이고 총량이 아니다.
|
|
419
|
+
// list()에 100을 넘기면 400이 아니라 요청 전에 BadRequestError로 거절된다.
|
|
420
|
+
import { RECORDS_PAGE_LIMIT_MAX } from "@reopt-ai/brandapp-sdk/eav"; // 100
|
|
416
421
|
for await (const record of sdk.eav.records.listAll(entityId)) { ... }
|
|
417
422
|
```
|
|
418
423
|
|
|
@@ -430,7 +435,8 @@ where("deletedAt").isNull();
|
|
|
430
435
|
const w = createFilterBuilder(ATTRIBUTE_IDS.contacts);
|
|
431
436
|
w("status").eq("active"); // TypeScript validates field names
|
|
432
437
|
|
|
433
|
-
// Operators: eq, neq, contains, gt, lt, gte, lte, isNull, isNotNull, after, before
|
|
438
|
+
// Operators: eq, neq, in, notIn, contains, gt, lt, gte, lte, isNull, isNotNull, after, before
|
|
439
|
+
// in/notIn은 빈 배열을 받지 않는다(400) — "제외 없음"은 필터를 빼서 표현한다.
|
|
434
440
|
```
|
|
435
441
|
|
|
436
442
|
## Schema & JSON Schema
|
|
@@ -505,7 +511,9 @@ export async function generateMetadata({ params }): Promise<Metadata> {
|
|
|
505
511
|
|
|
506
512
|
// app/sitemap.ts — Next.js MetadataRoute.Sitemap
|
|
507
513
|
export default async function sitemap() {
|
|
508
|
-
|
|
514
|
+
// limit 상한은 100 — 그 이상은 더 큰 페이지가 아니라 400이다. 글이 더 많으면
|
|
515
|
+
// page를 돌려 모은다(EAV는 sdk.eav.records.listAll()이 대신 돌아 준다).
|
|
516
|
+
const { records } = await sdk.cms.posts.list({ status: "published", limit: 100 });
|
|
509
517
|
return toSitemapItems(records, {
|
|
510
518
|
siteUrl: "https://www.example.com",
|
|
511
519
|
basePath?: "/blog", // Default "/blog"
|
package/docs/cms.md
CHANGED
|
@@ -149,9 +149,11 @@ import type { MetadataRoute } from "next";
|
|
|
149
149
|
import { toSitemapItems } from "@reopt-ai/brandapp-sdk/cms";
|
|
150
150
|
|
|
151
151
|
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|
152
|
+
// limit 상한은 100 — 그 이상은 더 큰 페이지가 아니라 400이다.
|
|
153
|
+
// 글이 100개를 넘으면 page를 올려 가며 모은다.
|
|
152
154
|
const { records } = await sdk.cms.posts.list({
|
|
153
155
|
status: "published",
|
|
154
|
-
limit:
|
|
156
|
+
limit: 100,
|
|
155
157
|
sortBy: "publishedAt",
|
|
156
158
|
sortOrder: "desc",
|
|
157
159
|
});
|
package/docs/dev-server.md
CHANGED
|
@@ -87,7 +87,7 @@ await dev.seed({
|
|
|
87
87
|
| --------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
88
88
|
| **EAV** | `/api/v1/brandapp/{id}/eav/*` | Entity/Attribute/Record CRUD + 벌크 + 필터링 + 정렬 |
|
|
89
89
|
| **Auth** | `/api/v1/brandapp/{id}/auth/adapter` | Better Auth 어댑터 (user/session/account/verification CRUD) |
|
|
90
|
-
| **AI** | `/api/v1/brandapp/{id}/ai/*` | Mock 텍스트/이미지 생성, 모델 목록,
|
|
90
|
+
| **AI** | `/api/v1/brandapp/{id}/ai/*` | Mock 텍스트/이미지 생성, 모델 목록, 사용량 |
|
|
91
91
|
| **Files** | `/api/v1/brandapp/{id}/files/*` | 인메모리 파일 업로드/다운로드/삭제 |
|
|
92
92
|
| **CMS** | `/api/v1/brandapp/{id}/cms/*` | Post/PostGroup CRUD |
|
|
93
93
|
| **OAuth** | `/api/auth/.well-known/*`, `/api/auth/{token,jwks,oauth2/end-session}` | OIDC Discovery + EdDSA로 서명된 mock `id_token` + JWKS + RP-initiated end-session (faithful OIDC mock) |
|
package/docs/errors.md
CHANGED
|
@@ -50,7 +50,7 @@ treating a transient JWKS outage as a permanently bad token). See
|
|
|
50
50
|
`sdk.files.*` 도메인 코드. 409는 `ConflictError`로, 413/415는 base
|
|
51
51
|
`ReoptSDKError`로 도착한다 — `.code`/`.status`로 분기하면 된다. ⚠️ 402는 클래스
|
|
52
52
|
매핑이 status 단위라 저장공간 초과도 **`CreditLimitError` 클래스**로 도착한다
|
|
53
|
-
(이름과 달리 AI
|
|
53
|
+
(이름과 달리 AI 사용량이 아님) — `.code === "STORAGE_LIMIT"`으로 구분할 것.
|
|
54
54
|
|
|
55
55
|
| Code | Status | Class | When |
|
|
56
56
|
| -------------------------- | ------ | ------------------ | ------------------------------------------------------------------------ |
|
|
@@ -70,26 +70,26 @@ These extend the general classes above so existing `instanceof ConflictError` /
|
|
|
70
70
|
`instanceof BadRequestError` checks keep working — narrower classes just give
|
|
71
71
|
you a more direct branch when you care about the specific case.
|
|
72
72
|
|
|
73
|
-
| Error Class | Extends | Status | Code | When
|
|
74
|
-
| --------------------------- | --------------- | ------- | ------------------------- |
|
|
75
|
-
| `AuthUserRecordExistsError` | `ConflictError` | 409 | `AUTH_USER_RECORD_EXISTS` | 1:1 메타 entity에 같은 user의 record가 이미 있음 (→ upsert)
|
|
76
|
-
| `DuplicateAuthUserError` | `ConflictError` | 409 | `DUPLICATE_AUTH_USER` | bulk create 입력에 같은 authUserId가 중복
|
|
77
|
-
| `AuthUserNotFoundError` | `ReoptSDKError` | 400/422 | `AUTH_USER_NOT_FOUND` | 참조한 authUserId가 이 brandapp에 없음
|
|
78
|
-
| `LimitExceededError` | `ReoptSDKError` | 422 | `LIMIT_EXCEEDED_*` | EAV 자원 한도 초과 (entity/attribute/record)
|
|
73
|
+
| Error Class | Extends | Status | Code | When |
|
|
74
|
+
| --------------------------- | --------------- | ------- | ------------------------- | ------------------------------------------------------------------------------- |
|
|
75
|
+
| `AuthUserRecordExistsError` | `ConflictError` | 409 | `AUTH_USER_RECORD_EXISTS` | 1:1 메타 entity에 같은 user의 record가 이미 있음 (→ upsert) |
|
|
76
|
+
| `DuplicateAuthUserError` | `ConflictError` | 409 | `DUPLICATE_AUTH_USER` | bulk create 입력에 같은 authUserId가 중복 |
|
|
77
|
+
| `AuthUserNotFoundError` | `ReoptSDKError` | 400/422 | `AUTH_USER_NOT_FOUND` | 참조한 authUserId가 이 brandapp에 없음 |
|
|
78
|
+
| `LimitExceededError` | `ReoptSDKError` | 422 | `LIMIT_EXCEEDED_*` | EAV 자원 한도 초과 (entity/attribute/record) |
|
|
79
79
|
| `PreconditionFailedError` | `ReoptSDKError` | 412 | `PRECONDITION_FAILED` | `records.update(..., { ifVersion })`의 version이 현재와 다름 — 다시 읽고 재시도 |
|
|
80
80
|
|
|
81
81
|
추가 EAV 코드 (전용 클래스 없이 일반 클래스 + `.code`로 분기):
|
|
82
82
|
|
|
83
|
-
| Code | Status | Class | Notes
|
|
84
|
-
| ----------------------- | ------ | ----------------- |
|
|
85
|
-
| `ENTITY_NOT_FOUND` | 404 | `NotFoundError` | URL의 entityId가 이 brandapp 소속이 아님
|
|
86
|
-
| `ATTRIBUTE_NOT_FOUND` | 404 | `NotFoundError` | URL의 attributeId가 entity 소속이 아님
|
|
87
|
-
| `RECORD_NOT_FOUND` | 404 | `NotFoundError` | URL의 recordId가 entity 소속이 아님
|
|
88
|
-
| `USER_NOT_FOUND` | 404 | `NotFoundError` | `/users/:authUserId/records` 경로의 user가 brandapp에 없음
|
|
89
|
-
| `RECORDS_NOT_FOUND` | 400 | `BadRequestError` | bulkUpdate에서 일부 record id가 entity에 없음
|
|
90
|
-
| `DUPLICATE_RECORD_ID` | 409 | `ConflictError` | bulkUpdate(brandappAuthUser) 입력에 같은 record id가 중복
|
|
83
|
+
| Code | Status | Class | Notes |
|
|
84
|
+
| ----------------------- | ------ | ----------------- | -------------------------------------------------------------------------- |
|
|
85
|
+
| `ENTITY_NOT_FOUND` | 404 | `NotFoundError` | URL의 entityId가 이 brandapp 소속이 아님 |
|
|
86
|
+
| `ATTRIBUTE_NOT_FOUND` | 404 | `NotFoundError` | URL의 attributeId가 entity 소속이 아님 |
|
|
87
|
+
| `RECORD_NOT_FOUND` | 404 | `NotFoundError` | URL의 recordId가 entity 소속이 아님 |
|
|
88
|
+
| `USER_NOT_FOUND` | 404 | `NotFoundError` | `/users/:authUserId/records` 경로의 user가 brandapp에 없음 |
|
|
89
|
+
| `RECORDS_NOT_FOUND` | 400 | `BadRequestError` | bulkUpdate에서 일부 record id가 entity에 없음 |
|
|
90
|
+
| `DUPLICATE_RECORD_ID` | 409 | `ConflictError` | bulkUpdate(brandappAuthUser) 입력에 같은 record id가 중복 |
|
|
91
91
|
| `QUERY_TOO_BROAD` | 422 | `ReoptSDKError` | 필터 후보가 인메모리 상한(10k행)을 넘음 — `eq`/`in`/`authUserId`로 좁힐 것 |
|
|
92
|
-
| `AUTH_USER_ID_REQUIRED` | 400 | `BadRequestError` | `linkedTo='brandappAuthUser'` entity인데 authUserId 누락
|
|
92
|
+
| `AUTH_USER_ID_REQUIRED` | 400 | `BadRequestError` | `linkedTo='brandappAuthUser'` entity인데 authUserId 누락 |
|
|
93
93
|
|
|
94
94
|
All classes extend `ReoptSDKError`, so `instanceof ReoptSDKError` and
|
|
95
95
|
`isReoptSDKError(err)` match every SDK error.
|