@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.
Files changed (66) hide show
  1. package/CHANGELOG.md +31 -2
  2. package/README.md +1 -1
  3. package/dist/ai/index.d.ts +1 -1
  4. package/dist/ai/index.js +1 -1
  5. package/dist/ai-provider/index.js +77 -66
  6. package/dist/analytics/index.d.ts +1 -1
  7. package/dist/analytics/index.js +1 -1
  8. package/dist/auth/index.d.ts +1 -1
  9. package/dist/auth/index.js +1 -1
  10. package/dist/better-auth/index.d.ts +2 -2
  11. package/dist/better-auth/index.js +2 -2
  12. package/dist/{client-D5F6-YYU.d.ts → client-7I-mz3Dw.d.ts} +2 -2
  13. package/dist/{client-bXAnGNzC.d.ts → client-BSW0Ncjj.d.ts} +2 -2
  14. package/dist/{client-CNPfjmT0.d.ts → client-Bfutv3LK.d.ts} +2 -2
  15. package/dist/{client-ClX0it9Z.js → client-C4sDbXto.js} +70 -6
  16. package/dist/{client-DjgoTlfv.d.ts → client-C6OXGMMV.d.ts} +2 -2
  17. package/dist/{client-CeYaCY1n.d.ts → client-COKDtHO9.d.ts} +7 -5
  18. package/dist/{client-BOEyVc8V.d.ts → client-CniCGdmi.d.ts} +2 -2
  19. package/dist/{client-C1zORyWz.js → client-CuM8MNS5.js} +2 -2
  20. package/dist/{client-DEY11EBB.d.ts → client-D1AFtJRw.d.ts} +10 -10
  21. package/dist/{client-DY62Nb7m.js → client-DYkDNPyN.js} +2 -2
  22. package/dist/{client-C5CsGtWK.js → client-D_6WdWsc.js} +3 -3
  23. package/dist/{client-DYammrtw.d.ts → client-Dmvtr1nS.d.ts} +2 -2
  24. package/dist/{client-oDJVL5JF.js → client-DsM84EZZ.js} +3 -3
  25. package/dist/{client-DfGEiRKb.js → client-DuATTvcr.js} +2 -2
  26. package/dist/{client-C3hlUyaZ.js → client-EG1p7FL0.js} +2 -2
  27. package/dist/{client-CRim5LCH.d.ts → client-IUSZDJio.d.ts} +2 -2
  28. package/dist/{client-DR5Eb36i.js → client-afAv7Ebi.js} +16 -9
  29. package/dist/{client-Dd1QpCUq.js → client-mD6o-qVl.js} +2 -2
  30. package/dist/{client-B_7XihyW.js → client-s2uJ3OML.js} +2 -2
  31. package/dist/{client-BBxhqs8l.d.ts → client-yKeRJnIB.d.ts} +2 -2
  32. package/dist/cms/index.d.ts +1 -1
  33. package/dist/cms/index.js +1 -1
  34. package/dist/{config-BrJAy95F.js → config-C_OFYAgP.js} +5 -5
  35. package/dist/{config-D28P8iwm.d.ts → config-D3SblxWt.d.ts} +19 -2
  36. package/dist/dev/index.js +15 -5
  37. package/dist/eav/index.d.ts +4 -4
  38. package/dist/eav/index.js +3 -33
  39. package/dist/eav/migrate.d.ts +2 -2
  40. package/dist/eav/schema.d.ts +2 -2
  41. package/dist/{errors-BnIRV-Px.d.ts → errors-U3TsyWVq.d.ts} +2 -2
  42. package/dist/feedback/index.d.ts +1 -1
  43. package/dist/feedback/index.js +1 -1
  44. package/dist/files/index.d.ts +1 -1
  45. package/dist/files/index.js +1 -1
  46. package/dist/{http-client-Dw_U7Wgx.js → http-client-BUbFBOvG.js} +2 -2
  47. package/dist/{index-CBPdczmp.d.ts → index-BnAYxnwq.d.ts} +12 -12
  48. package/dist/index.d.ts +5 -5
  49. package/dist/index.js +12 -12
  50. package/dist/logout/index.d.ts +1 -1
  51. package/dist/logout/index.js +1 -1
  52. package/dist/plans/index.d.ts +1 -1
  53. package/dist/plans/index.js +1 -1
  54. package/dist/push/index.d.ts +1 -1
  55. package/dist/push/index.js +1 -1
  56. package/dist/{query-l08AoqXP.js → query-BkdTSuB5.js} +2 -2
  57. package/dist/react/hooks.d.ts +6 -6
  58. package/dist/react/hooks.js +1 -1
  59. package/dist/terms/index.d.ts +1 -1
  60. package/dist/terms/index.js +1 -1
  61. package/dist/testing/index.d.ts +1 -1
  62. package/docs/api-reference.md +20 -12
  63. package/docs/cms.md +3 -1
  64. package/docs/dev-server.md +1 -1
  65. package/docs/errors.md +16 -16
  66. 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-BrJAy95F.js";
2
- import { t as BaseHttpClient } from "./http-client-Dw_U7Wgx.js";
3
- import { n as createReoptAiClient } from "./client-DR5Eb36i.js";
4
- import { n as createReoptAuthClient } from "./client-DfGEiRKb.js";
5
- import { t as createReoptCmsClient } from "./client-C5CsGtWK.js";
6
- import { t as createReoptEavClient } from "./client-ClX0it9Z.js";
7
- import { n as createReoptFeedbackClient } from "./client-DY62Nb7m.js";
8
- import { n as createReoptFileClient } from "./client-oDJVL5JF.js";
9
- import { n as createReoptAnalyticsClient } from "./client-C3hlUyaZ.js";
10
- import { n as createReoptPlansClient } from "./client-Dd1QpCUq.js";
11
- import { n as createReoptPushClient } from "./client-C1zORyWz.js";
12
- import { n as createReoptTermsClient } from "./client-B_7XihyW.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-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;
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "../config-D28P8iwm.js";
1
+ import { n as ReoptSDKConfig } from "../config-D3SblxWt.js";
2
2
  //#region src/logout/verify.d.ts
3
3
  type VerifyLogoutTokenOptions = {
4
4
  /** 자기 OAuth client_id — logout_token `aud` 검증. 미지정 시 config/env에서 유도. */
@@ -1,4 +1,4 @@
1
- import { S as ReoptSDKError, a as resolveIdBaseUrl } from "../config-BrJAy95F.js";
1
+ import { S as ReoptSDKError, a as resolveIdBaseUrl } from "../config-C_OFYAgP.js";
2
2
 
3
3
  //#region src/logout/verify.ts
4
4
  /**
@@ -1,2 +1,2 @@
1
- import { a as CheckoutStatus, c as MeterPricingMode, d as PlanInterval, f as PlanMeter, i as CheckoutSession, l as Plan, m as PlanRequiredTerms, n as createReoptPlansClient, o as CreateCheckoutInput, p as PlanMeterTier, r as CancelSubscriptionResult, s as CurrentPlan, t as ReoptPlansClient, u as PlanBillingModel } from "../client-CRim5LCH.js";
1
+ import { a as CheckoutStatus, c as MeterPricingMode, d as PlanInterval, f as PlanMeter, i as CheckoutSession, l as Plan, m as PlanRequiredTerms, n as createReoptPlansClient, o as CreateCheckoutInput, p as PlanMeterTier, r as CancelSubscriptionResult, s as CurrentPlan, t as ReoptPlansClient, u as PlanBillingModel } from "../client-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 };
@@ -1,3 +1,3 @@
1
- import { n as createReoptPlansClient, t as ReoptPlansClient } from "../client-Dd1QpCUq.js";
1
+ import { n as createReoptPlansClient, t as ReoptPlansClient } from "../client-mD6o-qVl.js";
2
2
 
3
3
  export { ReoptPlansClient, createReoptPlansClient };
@@ -1,2 +1,2 @@
1
- import { a as RegisterPushTokenInput, c as UnregisterPushTokenInput, i as PushProvider, l as UnregisterPushTokenResult, n as createReoptPushClient, o as RegisterPushTokenResult, r as PushPlatform, s as RegisteredPushDevice, t as ReoptPushClient } from "../client-bXAnGNzC.js";
1
+ import { a as RegisterPushTokenInput, c as UnregisterPushTokenInput, i as PushProvider, l as UnregisterPushTokenResult, n as createReoptPushClient, o as RegisterPushTokenResult, r as PushPlatform, s as RegisteredPushDevice, t as ReoptPushClient } from "../client-BSW0Ncjj.js";
2
2
  export { type PushPlatform, type PushProvider, type RegisterPushTokenInput, type RegisterPushTokenResult, type RegisteredPushDevice, ReoptPushClient, type UnregisterPushTokenInput, type UnregisterPushTokenResult, createReoptPushClient };
@@ -1,3 +1,3 @@
1
- import { n as createReoptPushClient, t as ReoptPushClient } from "../client-C1zORyWz.js";
1
+ import { n as createReoptPushClient, t as ReoptPushClient } from "../client-CuM8MNS5.js";
2
2
 
3
3
  export { ReoptPushClient, createReoptPushClient };
@@ -1,4 +1,4 @@
1
- import { S as ReoptSDKError } from "./config-BrJAy95F.js";
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-l08AoqXP.js.map
35
+ //# sourceMappingURL=query-BkdTSuB5.js.map
@@ -1,9 +1,9 @@
1
- import { A as ListRecordsQuery, C as EavAttribute, D as EavRecord, E as EavEntity, F as UpsertRecordInput, I as UpsertRecordResult, P as UpdateRecordInput, S as DeleteWhereInput, _ as BulkUpdateItem, j as PaginatedResponse, x as CreateRecordInput } from "../config-D28P8iwm.js";
2
- import { a as CompletionOptions, f as ModelInfo, l as ImageGenerateOptions, o as CompletionResult, p as StreamDoneData, r as AgentInfo, s as CreditInfo, u as ImageGenerateResult } from "../client-DEY11EBB.js";
3
- import { v as ReoptSDKError } from "../errors-BnIRV-Px.js";
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-BOEyVc8V.js";
6
- import { t as ReoptSDK } from "../index-CBPdczmp.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-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
@@ -536,7 +536,7 @@ function useDeleteRecordsWhere(sdk, entityId, options) {
536
536
  });
537
537
  }
538
538
  /**
539
- * BrandApp AI 크레딧 잔액 조회
539
+ * BrandApp AI 사용량 잔액 조회
540
540
  *
541
541
  * @example
542
542
  * ```tsx
@@ -1,3 +1,3 @@
1
1
  import { a as CreateConsentsResult, c as TermsJurisdiction, d as TermsVersion, f as WithdrawConsentResult, i as CreateConsentsRequest, l as TermsListResponse, n as ConsentRecord, o as ListTermsOptions, r as ConsentStatus, s as TermsItem, t as ConsentInput, u as TermsType } from "../types-C69OzBn6.js";
2
- import { n as createReoptTermsClient, t as ReoptTermsClient } from "../client-BBxhqs8l.js";
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 };
@@ -1,3 +1,3 @@
1
- import { n as createReoptTermsClient, t as ReoptTermsClient } from "../client-B_7XihyW.js";
1
+ import { n as createReoptTermsClient, t as ReoptTermsClient } from "../client-s2uJ3OML.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-C6fyJTud.js";
2
- import { t as ReoptSDK } from "../index-CBPdczmp.js";
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 */
@@ -314,8 +314,8 @@ await generateText({
314
314
  });
315
315
 
316
316
  // Image generation via AI SDK
317
- import { experimental_generateImage } from "ai";
318
- const { image } = await experimental_generateImage({
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
- - `experimental_generateImage()` — 이미지 생성 (`brandapp.imageModel(...)`)
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
- **미지원** (호출은 동작하되 `warnings`로 알리고 해당 부분은 무시/손실 변환됨)
337
+ **미지원**
338
338
 
339
- - tool/function calling — `tools`는 경고 후 무시
340
- - 구조화 출력 — `generateObject()` / `responseFormat: { type: "json" }`는 미지원
341
- - 비전·파일 입력 — user 메시지의 image/file part는 드롭(경고)
342
- - `topP` / `topK` / `frequencyPenalty` / `presencePenalty` / `stopSequences` / `seed`
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 | 400 |
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
- const { records } = await sdk.cms.posts.list({ status: "published", limit: 200 });
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: 200,
156
+ limit: 100,
155
157
  sortBy: "publishedAt",
156
158
  sortOrder: "desc",
157
159
  });
@@ -87,7 +87,7 @@ await dev.seed({
87
87
  | --------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
88
88
  | **EAV** | `/api/v1/brandapp/{id}/eav/*` | Entity/Attribute/Record CRUD + 벌크 + 필터링 + 정렬 |
89
89
  | **Auth** | `/api/v1/brandapp/{id}/auth/adapter` | Better Auth 어댑터 (user/session/account/verification CRUD) |
90
- | **AI** | `/api/v1/brandapp/{id}/ai/*` | Mock 텍스트/이미지 생성, 모델 목록, 크레딧 |
90
+ | **AI** | `/api/v1/brandapp/{id}/ai/*` | Mock 텍스트/이미지 생성, 모델 목록, 사용량 |
91
91
  | **Files** | `/api/v1/brandapp/{id}/files/*` | 인메모리 파일 업로드/다운로드/삭제 |
92
92
  | **CMS** | `/api/v1/brandapp/{id}/cms/*` | Post/PostGroup CRUD |
93
93
  | **OAuth** | `/api/auth/.well-known/*`, `/api/auth/{token,jwks,oauth2/end-session}` | OIDC Discovery + EdDSA로 서명된 mock `id_token` + JWKS + RP-initiated end-session (faithful OIDC mock) |
package/docs/errors.md CHANGED
@@ -50,7 +50,7 @@ treating a transient JWKS outage as a permanently bad token). See
50
50
  `sdk.files.*` 도메인 코드. 409는 `ConflictError`로, 413/415는 base
51
51
  `ReoptSDKError`로 도착한다 — `.code`/`.status`로 분기하면 된다. ⚠️ 402는 클래스
52
52
  매핑이 status 단위라 저장공간 초과도 **`CreditLimitError` 클래스**로 도착한다
53
- (이름과 달리 AI 크레딧이 아님) — `.code === "STORAGE_LIMIT"`으로 구분할 것.
53
+ (이름과 달리 AI 사용량이 아님) — `.code === "STORAGE_LIMIT"`으로 구분할 것.
54
54
 
55
55
  | Code | Status | Class | When |
56
56
  | -------------------------- | ------ | ------------------ | ------------------------------------------------------------------------ |
@@ -70,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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reopt-ai/brandapp-sdk",
3
- "version": "4.2.0",
3
+ "version": "4.4.0",
4
4
  "description": "Reopt Brandapp SDK — Better Auth adapter, OAuth login, and EAV client",
5
5
  "author": "Reopt",
6
6
  "license": "MIT",