@reopt-ai/brandapp-sdk 3.3.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 (102) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/README.md +10 -1
  3. package/dist/abort--nOBFN4M.js +50 -0
  4. package/dist/ai/index.d.ts +2 -314
  5. package/dist/ai/index.js +3 -8
  6. package/dist/ai-provider/index.d.ts +79 -163
  7. package/dist/ai-provider/index.js +752 -685
  8. package/dist/auth/index.d.ts +27 -27
  9. package/dist/auth/index.js +41 -34
  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 -144
  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 +103 -86
  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 -528
  37. package/dist/dev/index.js +2731 -2967
  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 -126
  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-BjDFIyA6.d.ts → errors-CRCcErNC.d.ts} +55 -53
  48. package/dist/feedback/index.d.ts +2 -132
  49. package/dist/feedback/index.js +3 -6
  50. package/dist/files/index.d.ts +14 -14
  51. package/dist/files/index.js +41 -25
  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 -230
  56. package/dist/index.js +119 -71
  57. package/dist/logout/index.d.ts +56 -53
  58. package/dist/logout/index.js +232 -289
  59. package/dist/plans/index.d.ts +2 -236
  60. package/dist/plans/index.js +3 -6
  61. package/dist/push/index.d.ts +2 -79
  62. package/dist/push/index.js +3 -6
  63. package/dist/query-BvbCiGWb.js +35 -0
  64. package/dist/react/hooks.d.ts +97 -99
  65. package/dist/react/hooks.js +742 -404
  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 -6
  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 -50
  76. package/dist/webhooks/index.js +150 -127
  77. package/docs/api-reference.md +87 -6
  78. package/package.json +6 -5
  79. package/dist/chunk-2LSCQHAU.js +0 -21
  80. package/dist/chunk-4U4ZPPL4.js +0 -599
  81. package/dist/chunk-55KHY5GH.js +0 -96
  82. package/dist/chunk-C5VTRZWX.js +0 -458
  83. package/dist/chunk-F7BXBTZI.js +0 -54
  84. package/dist/chunk-FJUCWXX3.js +0 -350
  85. package/dist/chunk-H33OTQEN.js +0 -112
  86. package/dist/chunk-L4DHB36G.js +0 -75
  87. package/dist/chunk-OG7R3UAR.js +0 -105
  88. package/dist/chunk-PF24XU54.js +0 -32
  89. package/dist/chunk-QN3QD67K.js +0 -49
  90. package/dist/chunk-REIKXSMY.js +0 -7
  91. package/dist/chunk-UGBBXCZE.js +0 -157
  92. package/dist/chunk-UVT2E6KD.js +0 -81
  93. package/dist/chunk-YPLT3RFL.js +0 -63
  94. package/dist/chunk-YTKSAWV2.js +0 -463
  95. package/dist/client-BkcO-0C2.d.ts +0 -216
  96. package/dist/client-CN5_tNOC.d.ts +0 -147
  97. package/dist/client-DttyeM_h.d.ts +0 -102
  98. package/dist/config-CtxyJsDR.d.ts +0 -397
  99. package/dist/typed-client-BxOVIiMU.d.ts +0 -40
  100. package/dist/types-6E3ZLL9X.d.ts +0 -24
  101. package/dist/types-DskYLVb8.d.ts +0 -104
  102. package/dist/types-ckmDDW3N.d.ts +0 -129
@@ -1,24 +0,0 @@
1
- declare const REOPT_PROVIDER_ID: "reopt";
2
- declare const REOPT_DEFAULT_SCOPES: readonly ["openid", "profile", "email"];
3
- type AdapterOperation = "create" | "findOne" | "findMany" | "update" | "updateMany" | "delete" | "deleteMany" | "count";
4
- type AdapterRequestBody = {
5
- operation: AdapterOperation;
6
- model: "user" | "session" | "account" | "verification";
7
- data?: Record<string, unknown>;
8
- where?: Array<{
9
- field: string;
10
- value: unknown;
11
- operator?: string;
12
- connector?: "AND" | "OR";
13
- }>;
14
- update?: Record<string, unknown>;
15
- select?: string[];
16
- limit?: number;
17
- offset?: number;
18
- sortBy?: {
19
- field: string;
20
- direction: "asc" | "desc";
21
- };
22
- };
23
-
24
- export { type AdapterOperation as A, REOPT_DEFAULT_SCOPES as R, type AdapterRequestBody as a, REOPT_PROVIDER_ID as b };
@@ -1,104 +0,0 @@
1
- import { E as EditorSpec } from './types-ckmDDW3N.js';
2
-
3
- /**
4
- * Brandapp Terms types.
5
- *
6
- * Mirrors the response shape of `/api/v1/brandapp/{brandappId}/terms/*`.
7
- */
8
- type TermsType = "termsOfService" | "privacyPolicy" | "marketingConsent" | "custom";
9
- /** Mirrors the Prisma `BrandappTermsJurisdiction` enum. */
10
- type TermsJurisdiction = "global" | "KR" | "US" | "EU" | "GB" | "JP" | "CN" | "BR" | "CA" | "AU";
11
- type TermsVersion = {
12
- id: string;
13
- version: number;
14
- /** 본문 언어 (BCP 47, "ko-KR", "en-US"). */
15
- locale: string;
16
- /** Plain-text 본문 — 검색/법적 보존용. */
17
- content: string;
18
- /**
19
- * Rich 본문 — opt-editor `EditorSpec`과 호환되는 minimal shape.
20
- * 마이그레이션 이전에 작성된 약관은 plain text가 paragraph 1개로 자동 wrap되어 들어있다.
21
- * `null`은 백엔드 응답에 contentRich 필드가 빠진 구버전 호환을 위해 허용.
22
- */
23
- contentRich: EditorSpec | null;
24
- publishedAt: string;
25
- changeSummary: string | null;
26
- reConsentDeadline: string | null;
27
- };
28
- type TermsItem = {
29
- id: string;
30
- title: string;
31
- type: TermsType;
32
- /** 법적 관할권 */
33
- jurisdiction: TermsJurisdiction;
34
- isRequired: boolean;
35
- sortOrder: number;
36
- /** Null when no matching version exists for the requested locale. */
37
- currentVersion: TermsVersion | null;
38
- };
39
- /** Wrapper response with jurisdiction/locale matching metadata. */
40
- type TermsListResponse = {
41
- /** 매칭된 jurisdiction (사용자가 받은 약관 셋의 법적 관할권) */
42
- jurisdiction: TermsJurisdiction;
43
- /** 매칭 결정 출처 — geo / user_locale / accept_language / explicit / brandapp_default */
44
- jurisdictionSource: string;
45
- /** 매칭에 사용된 country (ISO 3166-1 alpha-2). null이면 brandapp default만 사용. */
46
- country: string | null;
47
- /** 매칭에 사용된 locale (BCP 47). */
48
- locale: string | null;
49
- /** 매칭된 약관 목록 */
50
- terms: TermsItem[];
51
- };
52
- type ConsentStatus = "granted" | "withdrawn" | "pendingReConsent";
53
- type ConsentRecord = {
54
- id: string;
55
- status: ConsentStatus;
56
- consentedAt: string;
57
- withdrawnAt: string | null;
58
- source: string | null;
59
- versionId: string;
60
- termsId: string;
61
- /** 동의 시점의 국가 (법적 증거) */
62
- consentCountry: string | null;
63
- /** 동의 시점의 locale (법적 증거) */
64
- consentLocale: string | null;
65
- };
66
- type ConsentInput = {
67
- versionId: string;
68
- consented: boolean;
69
- };
70
- type CreateConsentsRequest = {
71
- consents: ConsentInput[];
72
- /** Origin tag stored alongside each consent (e.g. "web", "mobile-app"). Defaults to "sdk". */
73
- source?: string;
74
- /** Optional caller IP, kept for legal evidence. Server falls back to undefined when omitted. */
75
- ipAddress?: string;
76
- /** 동의 시점의 사용자 국가 (ISO 3166-1 alpha-2). 미제공 시 서버가 헤더에서 추정. */
77
- country?: string;
78
- /** 동의 시점에 사용자가 본 locale (BCP 47). 미제공 시 서버가 헤더에서 추정. */
79
- locale?: string;
80
- /** User-Agent. 미제공 시 서버가 요청 헤더에서 추정. */
81
- userAgent?: string;
82
- };
83
- type CreateConsentsResult = {
84
- count: number;
85
- };
86
- type WithdrawConsentResult = {
87
- id: string;
88
- };
89
- /**
90
- * `list()` 호출 옵션. country/locale을 지정하면 백엔드가 매칭 약관 셋을 반환한다.
91
- * 미지정 시 백엔드가 요청 헤더 (`x-vercel-ip-country`, `Accept-Language`)에서 추정한다.
92
- */
93
- type ListTermsOptions = {
94
- /** ISO 3166-1 alpha-2 ("KR", "DE", "US"). */
95
- country?: string;
96
- /** BCP 47 ("ko-KR", "en-US"). */
97
- locale?: string;
98
- /** Explicit jurisdiction override. */
99
- jurisdiction?: TermsJurisdiction;
100
- /** Bearer token. 없으면 Basic Auth. */
101
- accessToken?: string;
102
- };
103
-
104
- export type { ConsentInput as C, ListTermsOptions as L, TermsItem as T, WithdrawConsentResult as W, ConsentRecord as a, ConsentStatus as b, CreateConsentsRequest as c, CreateConsentsResult as d, TermsJurisdiction as e, TermsListResponse as f, TermsType as g, TermsVersion as h };
@@ -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 };