@reopt-ai/brandapp-sdk 3.1.0 → 3.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 (104) hide show
  1. package/CHANGELOG.md +147 -0
  2. package/README.md +39 -14
  3. package/dist/abort--nOBFN4M.js +50 -0
  4. package/dist/ai/index.d.ts +2 -314
  5. package/dist/ai/index.js +3 -7
  6. package/dist/ai-provider/index.d.ts +79 -163
  7. package/dist/ai-provider/index.js +752 -671
  8. package/dist/auth/index.d.ts +27 -27
  9. package/dist/auth/index.js +41 -33
  10. package/dist/better-auth/client.d.ts +6 -5
  11. package/dist/better-auth/client.js +28 -5
  12. package/dist/better-auth/index.d.ts +19 -17
  13. package/dist/better-auth/index.js +180 -133
  14. package/dist/client-B1q5P8rv.js +83 -0
  15. package/dist/client-B9QHVhdM.js +77 -0
  16. package/dist/client-BGGd_cpV.d.ts +103 -0
  17. package/dist/client-BJcy1V1a.js +140 -0
  18. package/dist/client-Beivhucf.js +55 -0
  19. package/dist/client-BruP5_nU.d.ts +147 -0
  20. package/dist/client-D-yNxNfk.js +28 -0
  21. package/dist/client-D0eBxh8j.d.ts +284 -0
  22. package/dist/client-D3RHHUUW.d.ts +207 -0
  23. package/dist/client-D6gs61w8.d.ts +53 -0
  24. package/dist/client-DBnK7ooQ.js +86 -0
  25. package/dist/client-DDw5yz_h.d.ts +53 -0
  26. package/dist/client-DPmoKuR9.js +305 -0
  27. package/dist/client-DsdakibF.js +503 -0
  28. package/dist/client-Dxg8_DIH.d.ts +71 -0
  29. package/dist/client-EbhUIhHq.js +53 -0
  30. package/dist/client-lk6wBu_0.d.ts +48 -0
  31. package/dist/client-p49ol9pg.d.ts +124 -0
  32. package/dist/cms/index.d.ts +52 -108
  33. package/dist/cms/index.js +105 -84
  34. package/dist/config-CRytOPPl.d.ts +394 -0
  35. package/dist/config-Cw0a3-C8.js +487 -0
  36. package/dist/dev/index.d.ts +2 -509
  37. package/dist/dev/index.js +2740 -2873
  38. package/dist/eav/coerce.d.ts +3 -1
  39. package/dist/eav/coerce.js +72 -46
  40. package/dist/eav/index.d.ts +72 -100
  41. package/dist/eav/index.js +158 -125
  42. package/dist/eav/migrate.d.ts +112 -109
  43. package/dist/eav/migrate.js +230 -196
  44. package/dist/eav/schema.d.ts +111 -150
  45. package/dist/eav/schema.js +624 -603
  46. package/dist/encoding-Bwfm3iaE.js +21 -0
  47. package/dist/{errors-DIAS8Rsl.d.ts → errors-CRCcErNC.d.ts} +55 -53
  48. package/dist/feedback/index.d.ts +2 -132
  49. package/dist/feedback/index.js +3 -5
  50. package/dist/files/index.d.ts +14 -14
  51. package/dist/files/index.js +41 -24
  52. package/dist/http-client-QKUvvirs.js +386 -0
  53. package/dist/index-DrVaKfhs.d.ts +456 -0
  54. package/dist/index-Z6OGcurJ.d.ts +169 -0
  55. package/dist/index.d.ts +6 -221
  56. package/dist/index.js +119 -70
  57. package/dist/logout/index.d.ts +109 -0
  58. package/dist/logout/index.js +264 -0
  59. package/dist/plans/index.d.ts +2 -236
  60. package/dist/plans/index.js +3 -5
  61. package/dist/push/index.d.ts +2 -79
  62. package/dist/push/index.js +3 -5
  63. package/dist/query-BvbCiGWb.js +35 -0
  64. package/dist/react/hooks.d.ts +97 -95
  65. package/dist/react/hooks.js +742 -356
  66. package/dist/sse-parser-FMjxM7sY.js +86 -0
  67. package/dist/terms/index.d.ts +3 -79
  68. package/dist/terms/index.js +3 -5
  69. package/dist/testing/index.d.ts +52 -104
  70. package/dist/testing/index.js +94 -72
  71. package/dist/types-B-SMkH6s.d.ts +26 -0
  72. package/dist/types-BXDcoJHG.d.ts +131 -0
  73. package/dist/types-BrghN2rJ.d.ts +105 -0
  74. package/dist/types-DjDRszNj.js +11 -0
  75. package/dist/webhooks/index.d.ts +77 -47
  76. package/dist/webhooks/index.js +150 -127
  77. package/docs/api-reference.md +179 -2
  78. package/docs/dev-server.md +19 -18
  79. package/docs/errors.md +72 -15
  80. package/docs/logout.md +166 -0
  81. package/package.json +10 -5
  82. package/dist/chunk-2Q654O63.js +0 -350
  83. package/dist/chunk-F7BXBTZI.js +0 -54
  84. package/dist/chunk-IJOXTBIE.js +0 -599
  85. package/dist/chunk-JWXUVQRC.js +0 -157
  86. package/dist/chunk-L4DHB36G.js +0 -75
  87. package/dist/chunk-MRQY45U5.js +0 -465
  88. package/dist/chunk-N5JVE4WX.js +0 -449
  89. package/dist/chunk-O3PUWIDJ.js +0 -105
  90. package/dist/chunk-POLKEOYH.js +0 -63
  91. package/dist/chunk-R5CCGDUH.js +0 -49
  92. package/dist/chunk-RBHP7IZF.js +0 -96
  93. package/dist/chunk-REIKXSMY.js +0 -7
  94. package/dist/chunk-T7YTITRJ.js +0 -112
  95. package/dist/chunk-V73GORO3.js +0 -81
  96. package/dist/chunk-VRNBYSWU.js +0 -32
  97. package/dist/client-BkcO-0C2.d.ts +0 -216
  98. package/dist/client-CN5_tNOC.d.ts +0 -147
  99. package/dist/client-DttyeM_h.d.ts +0 -102
  100. package/dist/config-CtxyJsDR.d.ts +0 -397
  101. package/dist/typed-client-BxOVIiMU.d.ts +0 -40
  102. package/dist/types-6E3ZLL9X.d.ts +0 -24
  103. package/dist/types-DskYLVb8.d.ts +0 -104
  104. package/dist/types-ckmDDW3N.d.ts +0 -129
@@ -1,129 +0,0 @@
1
- /**
2
- * Reopt Editor 본문 형식 (post/document `contentRich`).
3
- *
4
- * `@reopt-ai/opt-editor`의 `EditorSpec`과 구조적으로 호환되는 minimal 타입.
5
- * SDK는 opt-editor에 직접 의존하지 않으므로(외부 GitHub Packages 의존을 피하기 위함),
6
- * 외부 앱은 이 값을 그대로 `<StaticRenderer spec={post.document.contentRich} ... />`에
7
- * 넘길 수 있다.
8
- *
9
- * @example
10
- * ```tsx
11
- * import { StaticRenderer } from "@reopt-ai/opt-editor";
12
- * import type { EditorSpec } from "@reopt-ai/brandapp-sdk/cms";
13
- *
14
- * const post = await sdk.cms.posts.getBySlug(slug);
15
- * return <StaticRenderer spec={post.document.contentRich} />;
16
- * ```
17
- */
18
- type EditorSpec = {
19
- /** Top-level element IDs in display order. */
20
- root: string[];
21
- /** Flat map of all elements by ID. */
22
- elements: Record<string, unknown>;
23
- /** Optimistic concurrency version. Incremented on every mutation. */
24
- version: number;
25
- };
26
- type PostStatus = "draft" | "scheduled" | "published" | "archived";
27
- type PostSeo = {
28
- metaTitle: string | null;
29
- metaDescription: string | null;
30
- metaKeywords: string | null;
31
- };
32
- type Post = {
33
- id: string;
34
- slug: string;
35
- title: string;
36
- status: PostStatus;
37
- publishedAt: string | null;
38
- createdAt: string;
39
- updatedAt: string;
40
- author: {
41
- id: string;
42
- name: string;
43
- image: string | null;
44
- };
45
- icon: string | null;
46
- coverImage: {
47
- id: string;
48
- url: string | null;
49
- } | null;
50
- group: {
51
- id: string;
52
- name: string;
53
- };
54
- tags: {
55
- id: string;
56
- text: string;
57
- }[];
58
- seo: PostSeo;
59
- };
60
- type PostDetail = Post & {
61
- document: {
62
- id: string;
63
- /** Plain-text 본문 (검색용). */
64
- content: string;
65
- /** Rich 본문 — opt-editor `EditorSpec`과 구조적으로 호환. */
66
- contentRich: EditorSpec;
67
- };
68
- };
69
- type ListPostsQuery = {
70
- page?: number;
71
- limit?: number;
72
- sortBy?: "createdAt" | "updatedAt" | "title" | "publishedAt";
73
- sortOrder?: "asc" | "desc";
74
- status?: PostStatus;
75
- groupId?: string;
76
- /**
77
- * 브랜드 범위 내 안정적 그룹 식별자. 신규 코드는 env 기반 groupId 대신 slug 사용 권장.
78
- * `groupId`와 동시에 지정되면 둘 다 AND 필터로 적용됨.
79
- */
80
- groupSlug?: string;
81
- search?: string;
82
- tags?: string[];
83
- };
84
- type PostGroup = {
85
- id: string;
86
- name: string;
87
- /**
88
- * 브랜드 범위 내 안정적 식별자. legacy row 또는 미설정 시 null.
89
- * SDK consumer는 slug 기반 조회를 권장하나, null 가능성을 고려해야 한다.
90
- */
91
- slug: string | null;
92
- color: string;
93
- createdAt: string;
94
- updatedAt: string;
95
- brand: {
96
- id: string;
97
- name: string;
98
- } | null;
99
- postCount: number;
100
- };
101
- type ListPostGroupsQuery = {
102
- page?: number;
103
- limit?: number;
104
- sortBy?: "createdAt" | "name";
105
- sortOrder?: "asc" | "desc";
106
- brandId?: string;
107
- search?: string;
108
- };
109
- type Tag = {
110
- id: string;
111
- text: string;
112
- /** Brand 범위 내에서 이 태그가 붙은 포스트 수. */
113
- postCount: number;
114
- };
115
- type ListTagsQuery = {
116
- /** 특정 그룹으로 필터 (id 기반). 미지정 시 brand 내 전체. */
117
- groupId?: string;
118
- /** 특정 그룹으로 필터 (slug 기반). `groupId`와 동시 지정 가능. */
119
- groupSlug?: string;
120
- };
121
- type CmsPaginatedResponse<T> = {
122
- records: T[];
123
- page: number;
124
- limit: number;
125
- total: number;
126
- totalPages: number;
127
- };
128
-
129
- export type { CmsPaginatedResponse as C, EditorSpec as E, ListPostGroupsQuery as L, Post as P, Tag as T, ListPostsQuery as a, ListTagsQuery as b, PostDetail as c, PostGroup as d, PostSeo as e, PostStatus as f };