@reopt-ai/brandapp-sdk 3.3.0 → 3.5.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 +115 -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-61ldOHMz.js +503 -0
  15. package/dist/client-7PCoxVhZ.js +28 -0
  16. package/dist/client-B7rZQ8Zi.d.ts +272 -0
  17. package/dist/client-BGGd_cpV.d.ts +103 -0
  18. package/dist/client-BoIuyx4S.js +273 -0
  19. package/dist/client-BruP5_nU.d.ts +147 -0
  20. package/dist/client-BxtZt405.js +305 -0
  21. package/dist/client-ByN3EQdk.js +83 -0
  22. package/dist/client-CAghoGD_.js +53 -0
  23. package/dist/client-C_pHsPlj.js +81 -0
  24. package/dist/client-D0eBxh8j.d.ts +284 -0
  25. package/dist/client-D6gs61w8.d.ts +53 -0
  26. package/dist/client-DDw5yz_h.d.ts +53 -0
  27. package/dist/client-Dxg8_DIH.d.ts +71 -0
  28. package/dist/client-aMR4CRB8.d.ts +211 -0
  29. package/dist/client-lk6wBu_0.d.ts +48 -0
  30. package/dist/client-wEVKLdly.js +55 -0
  31. package/dist/client-zF1RG2uA.js +86 -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-aml9oQpX.js +487 -0
  36. package/dist/dev/index.d.ts +2 -528
  37. package/dist/dev/index.js +3047 -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-BZc2mngq.js +386 -0
  53. package/dist/index-1j_738qk.d.ts +470 -0
  54. package/dist/index-CeOLGdyL.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-xWqtfkvR.js +35 -0
  64. package/dist/react/hooks.d.ts +157 -100
  65. package/dist/react/hooks.js +862 -406
  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 +121 -8
  78. package/docs/errors.md +19 -0
  79. package/docs/files.md +165 -7
  80. package/package.json +7 -6
  81. package/dist/chunk-2LSCQHAU.js +0 -21
  82. package/dist/chunk-4U4ZPPL4.js +0 -599
  83. package/dist/chunk-55KHY5GH.js +0 -96
  84. package/dist/chunk-C5VTRZWX.js +0 -458
  85. package/dist/chunk-F7BXBTZI.js +0 -54
  86. package/dist/chunk-FJUCWXX3.js +0 -350
  87. package/dist/chunk-H33OTQEN.js +0 -112
  88. package/dist/chunk-L4DHB36G.js +0 -75
  89. package/dist/chunk-OG7R3UAR.js +0 -105
  90. package/dist/chunk-PF24XU54.js +0 -32
  91. package/dist/chunk-QN3QD67K.js +0 -49
  92. package/dist/chunk-REIKXSMY.js +0 -7
  93. package/dist/chunk-UGBBXCZE.js +0 -157
  94. package/dist/chunk-UVT2E6KD.js +0 -81
  95. package/dist/chunk-YPLT3RFL.js +0 -63
  96. package/dist/chunk-YTKSAWV2.js +0 -463
  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
@@ -0,0 +1,21 @@
1
+ //#region src/core/encoding.ts
2
+ /** Edge-safe base64 encoding (no Buffer dependency) */
3
+ function encodeBase64(str) {
4
+ const bytes = new TextEncoder().encode(str);
5
+ const binString = Array.from(bytes, (b) => String.fromCodePoint(b)).join("");
6
+ return btoa(binString);
7
+ }
8
+ /** Create a Basic auth header from client credentials */
9
+ function createBasicAuthHeader(clientId, clientSecret) {
10
+ return `Basic ${encodeBase64(`${clientId}:${clientSecret}`)}`;
11
+ }
12
+ /** Create the SDK Authorization header, preferring a short-lived service token. */
13
+ function createAuthHeader(config) {
14
+ const token = config.token?.trim();
15
+ if (token) return `Bearer ${token}`;
16
+ return createBasicAuthHeader(config.clientId ?? "", config.clientSecret ?? "");
17
+ }
18
+
19
+ //#endregion
20
+ export { createAuthHeader as t };
21
+ //# sourceMappingURL=encoding-Bwfm3iaE.js.map
@@ -1,83 +1,84 @@
1
+ //#region src/core/errors.d.ts
1
2
  type ReoptSDKErrorContext = {
2
- method?: string;
3
- url?: string;
4
- attempt?: number;
5
- /**
6
- * The X-Request-Id sent with the failing request (mirrored back by the
7
- * server when supported). Use this when reporting bugs to support — it
8
- * uniquely identifies the request in our logs.
9
- */
10
- requestId?: string;
3
+ method?: string;
4
+ url?: string;
5
+ attempt?: number;
6
+ /**
7
+ * The X-Request-Id sent with the failing request (mirrored back by the
8
+ * server when supported). Use this when reporting bugs to support — it
9
+ * uniquely identifies the request in our logs.
10
+ */
11
+ requestId?: string;
11
12
  };
12
13
  /** 구조화된 진단 정보 — AI 에이전트가 파싱하여 자동 해결 시도 가능 */
13
14
  type ErrorDiagnostic = {
14
- /** 에러 원인 설명 */
15
- cause: string;
16
- /** 해결 방법 (에이전트가 실행 가능한 단계) */
17
- fix: string;
18
- /** 관련 환경변수 */
19
- envVar?: string;
20
- /** 관련 문서 경로 (node_modules/@reopt-ai/brandapp-sdk/docs/ 기준) */
21
- doc?: string;
15
+ /** 에러 원인 설명 */
16
+ cause: string;
17
+ /** 해결 방법 (에이전트가 실행 가능한 단계) */
18
+ fix: string;
19
+ /** 관련 환경변수 */
20
+ envVar?: string;
21
+ /** 관련 문서 경로 (node_modules/@reopt-ai/brandapp-sdk/docs/ 기준) */
22
+ doc?: string;
22
23
  };
23
24
  declare class ReoptSDKError extends Error {
24
- readonly status: number;
25
- readonly code: string;
26
- readonly context?: ReoptSDKErrorContext;
27
- readonly diagnostic?: ErrorDiagnostic;
28
- constructor(message: string, status: number, code: string, context?: ReoptSDKErrorContext, diagnostic?: ErrorDiagnostic);
25
+ readonly status: number;
26
+ readonly code: string;
27
+ readonly context?: ReoptSDKErrorContext;
28
+ readonly diagnostic?: ErrorDiagnostic;
29
+ constructor(message: string, status: number, code: string, context?: ReoptSDKErrorContext, diagnostic?: ErrorDiagnostic);
29
30
  }
30
31
  declare class AuthError extends ReoptSDKError {
31
- constructor(message?: string, context?: ReoptSDKErrorContext);
32
+ constructor(message?: string, context?: ReoptSDKErrorContext);
32
33
  }
33
34
  declare class RateLimitError extends ReoptSDKError {
34
- constructor(message?: string, retryAfterMs?: number, context?: ReoptSDKErrorContext);
35
+ constructor(message?: string, retryAfterMs?: number, context?: ReoptSDKErrorContext);
35
36
  }
36
37
  declare class ServerError extends ReoptSDKError {
37
- constructor(message?: string, context?: ReoptSDKErrorContext);
38
+ constructor(message?: string, context?: ReoptSDKErrorContext);
38
39
  }
39
40
  /** AI 크레딧 잔액 부족 (HTTP 402). */
40
41
  declare class CreditLimitError extends ReoptSDKError {
41
- constructor(message?: string, context?: ReoptSDKErrorContext, code?: string);
42
+ constructor(message?: string, context?: ReoptSDKErrorContext, code?: string);
42
43
  }
43
44
  /**
44
45
  * 요청한 모델이 현재 plan tier에서 허용되지 않음 (HTTP 403, `MODEL_ACCESS_DENIED`).
45
46
  * 일반 권한 실패(`ForbiddenError`)와 구분해 모델 선택/업그레이드 안내를 준다.
46
47
  */
47
48
  declare class ModelAccessError extends ReoptSDKError {
48
- constructor(message?: string, context?: ReoptSDKErrorContext);
49
+ constructor(message?: string, context?: ReoptSDKErrorContext);
49
50
  }
50
51
  /** 알 수 없는 모델 ID (HTTP 404, `MODEL_NOT_FOUND`). */
51
52
  declare class ModelNotFoundError extends ReoptSDKError {
52
- constructor(message?: string, context?: ReoptSDKErrorContext);
53
+ constructor(message?: string, context?: ReoptSDKErrorContext);
53
54
  }
54
55
  /** 콘텐츠 정책 위반으로 생성 거부 (HTTP 422, `CONTENT_FILTER`). */
55
56
  declare class ContentFilterError extends ReoptSDKError {
56
- constructor(message?: string, context?: ReoptSDKErrorContext);
57
+ constructor(message?: string, context?: ReoptSDKErrorContext);
57
58
  }
58
59
  declare class BadRequestError extends ReoptSDKError {
59
- constructor(message?: string, context?: ReoptSDKErrorContext, code?: string);
60
+ constructor(message?: string, context?: ReoptSDKErrorContext, code?: string);
60
61
  }
61
62
  declare class ForbiddenError extends ReoptSDKError {
62
- constructor(message?: string, context?: ReoptSDKErrorContext, code?: string);
63
+ constructor(message?: string, context?: ReoptSDKErrorContext, code?: string);
63
64
  }
64
65
  declare class NotFoundError extends ReoptSDKError {
65
- constructor(message?: string, context?: ReoptSDKErrorContext, code?: string);
66
+ constructor(message?: string, context?: ReoptSDKErrorContext, code?: string);
66
67
  }
67
68
  declare class ConflictError extends ReoptSDKError {
68
- constructor(message?: string, context?: ReoptSDKErrorContext, code?: string);
69
+ constructor(message?: string, context?: ReoptSDKErrorContext, code?: string);
69
70
  }
70
71
  /** 한 brandapp user에 이미 같은 EAV entity의 record가 존재 (1:1 메타 위반). */
71
72
  declare class AuthUserRecordExistsError extends ConflictError {
72
- constructor(message?: string, context?: ReoptSDKErrorContext);
73
+ constructor(message?: string, context?: ReoptSDKErrorContext);
73
74
  }
74
75
  /** bulk create 입력에 같은 authUserId가 중복으로 등장 (1:1 메타 위반). */
75
76
  declare class DuplicateAuthUserError extends ConflictError {
76
- constructor(message?: string, context?: ReoptSDKErrorContext);
77
+ constructor(message?: string, context?: ReoptSDKErrorContext);
77
78
  }
78
79
  /** 참조한 brandappAuthUser가 이 brandapp에 존재하지 않음. status는 호출 경로에 따라 400 또는 422. */
79
80
  declare class AuthUserNotFoundError extends ReoptSDKError {
80
- constructor(message?: string, status?: 400 | 422, context?: ReoptSDKErrorContext);
81
+ constructor(message?: string, status?: 400 | 422, context?: ReoptSDKErrorContext);
81
82
  }
82
83
  /**
83
84
  * EAV 한도 초과 — entity/attribute/record 수가 plan 한도를 넘음.
@@ -87,7 +88,7 @@ declare class AuthUserNotFoundError extends ReoptSDKError {
87
88
  * - `LIMIT_EXCEEDED_RECORDS`
88
89
  */
89
90
  declare class LimitExceededError extends ReoptSDKError {
90
- constructor(message: string, code: "LIMIT_EXCEEDED_ENTITIES" | "LIMIT_EXCEEDED_ATTRIBUTES" | "LIMIT_EXCEEDED_RECORDS", context?: ReoptSDKErrorContext);
91
+ constructor(message: string, code: "LIMIT_EXCEEDED_ENTITIES" | "LIMIT_EXCEEDED_ATTRIBUTES" | "LIMIT_EXCEEDED_RECORDS", context?: ReoptSDKErrorContext);
91
92
  }
92
93
  /**
93
94
  * 플랜 구독(checkout) 전에 동의해야 하는 필수 약관이 미동의 상태 (HTTP 422,
@@ -106,19 +107,19 @@ declare class LimitExceededError extends ReoptSDKError {
106
107
  * ```
107
108
  */
108
109
  declare class RequiredTermsError extends ReoptSDKError {
109
- readonly missingTermsIds: string[];
110
- constructor(message?: string, missingTermsIds?: string[], context?: ReoptSDKErrorContext);
110
+ readonly missingTermsIds: string[];
111
+ constructor(message?: string, missingTermsIds?: string[], context?: ReoptSDKErrorContext);
111
112
  }
112
113
  /** Bundle-safe type guard for RequiredTermsError */
113
114
  declare function isRequiredTermsError(error: unknown): error is RequiredTermsError;
114
115
  /** 필드 수준 검증 에러 */
115
116
  type FieldError = {
116
- /** 필드 이름 (attribute name) */
117
- field: string;
118
- /** 에러 메시지 */
119
- message: string;
120
- /** 에러 코드 (e.g. "required", "invalid_format", "too_long") */
121
- code?: string;
117
+ /** 필드 이름 (attribute name) */
118
+ field: string;
119
+ /** 에러 메시지 */
120
+ message: string;
121
+ /** 에러 코드 (e.g. "required", "invalid_format", "too_long") */
122
+ code?: string;
122
123
  };
123
124
  /**
124
125
  * 필드 수준 검증 에러
@@ -141,12 +142,12 @@ type FieldError = {
141
142
  * ```
142
143
  */
143
144
  declare class ValidationError extends ReoptSDKError {
144
- readonly fieldErrors: FieldError[];
145
- constructor(message: string, fieldErrors: FieldError[], context?: ReoptSDKErrorContext);
146
- /** 특정 필드의 에러 메시지 반환 */
147
- getFieldError(field: string): string | undefined;
148
- /** 필드 → 메시지 맵 반환 */
149
- toFieldMap(): Record<string, string>;
145
+ readonly fieldErrors: FieldError[];
146
+ constructor(message: string, fieldErrors: FieldError[], context?: ReoptSDKErrorContext);
147
+ /** 특정 필드의 에러 메시지 반환 */
148
+ getFieldError(field: string): string | undefined;
149
+ /** 필드 → 메시지 맵 반환 */
150
+ toFieldMap(): Record<string, string>;
150
151
  }
151
152
  /** Bundle-safe type guard for ValidationError */
152
153
  declare function isValidationError(error: unknown): error is ValidationError;
@@ -176,5 +177,6 @@ declare function isModelAccessError(error: unknown): error is ModelAccessError;
176
177
  * throw할지 `lastError`에 담을지 결정한다.
177
178
  */
178
179
  declare function mapHttpStatusToError(status: number, code: string | undefined, message: string | undefined, ctx?: ReoptSDKErrorContext, fieldErrors?: FieldError[]): ReoptSDKError;
179
-
180
- export { AuthError as A, BadRequestError as B, ConflictError as C, DuplicateAuthUserError as D, type ErrorDiagnostic as E, type FieldError as F, LimitExceededError as L, ModelAccessError as M, NotFoundError as N, RateLimitError as R, ServerError as S, ValidationError as V, AuthUserNotFoundError as a, AuthUserRecordExistsError as b, ContentFilterError as c, CreditLimitError as d, ForbiddenError as e, ModelNotFoundError as f, ReoptSDKError as g, type ReoptSDKErrorContext as h, RequiredTermsError as i, isCreditLimitError as j, isModelAccessError as k, isReoptSDKError as l, isRequiredTermsError as m, isValidationError as n, mapHttpStatusToError as o };
180
+ //#endregion
181
+ export { isModelAccessError as C, mapHttpStatusToError as D, isValidationError as E, isCreditLimitError as S, isRequiredTermsError as T, ReoptSDKError as _, ConflictError as a, ServerError as b, DuplicateAuthUserError as c, ForbiddenError as d, LimitExceededError as f, RateLimitError 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, ReoptSDKErrorContext as v, isReoptSDKError as w, ValidationError as x, RequiredTermsError as y };
182
+ //# sourceMappingURL=errors-CRCcErNC.d.ts.map
@@ -1,132 +1,2 @@
1
- import { q as ReoptSDKConfig } from '../config-CtxyJsDR.js';
2
-
3
- /** Feedback processing status. */
4
- type FeedbackStatus = "new" | "in_progress" | "responded" | "archived";
5
- /**
6
- * A reply the workspace staff sent for a feedback. Only public fields are
7
- * exposed — the responding staff identity is never included.
8
- */
9
- type FeedbackReply = {
10
- id: string;
11
- content: string;
12
- /** ISO datetime */
13
- createdAt: string;
14
- };
15
- /** A customer feedback item as returned by the Brandapp Feedback API. */
16
- type Feedback = {
17
- id: string;
18
- title: string | null;
19
- content: string;
20
- category: string | null;
21
- /** 1–5, when the feedback carried a rating */
22
- rating: number | null;
23
- status: FeedbackStatus;
24
- /** Linked reopt Customer id (null = anonymous) */
25
- customerId: string | null;
26
- replyCount: number;
27
- /** ISO datetime */
28
- createdAt: string;
29
- };
30
- /** Feedback detail including the reply thread. */
31
- type FeedbackDetail = Feedback & {
32
- replies: FeedbackReply[];
33
- };
34
- type CreateFeedbackInput = {
35
- /** Feedback body (1–8000 chars). */
36
- content: string;
37
- title?: string;
38
- category?: string;
39
- /** 1–5 */
40
- rating?: number;
41
- /**
42
- * Customer id to attribute the feedback to (app-credential path only —
43
- * the server verifies the customer is linked to this brandapp). Ignored
44
- * on the `me.*` path where the token's customer is used.
45
- */
46
- customerId?: string;
47
- /** Free-form metadata (max 4000 chars serialized). */
48
- metadata?: Record<string, unknown>;
49
- };
50
- type ListFeedbackQuery = {
51
- status?: FeedbackStatus;
52
- /** Filter by linked Customer id (app-credential path only). */
53
- customerId?: string;
54
- /** 1-based page (default 1). */
55
- page?: number;
56
- /** Page size 1–100 (default 20). */
57
- limit?: number;
58
- };
59
- type FeedbackListMeta = {
60
- page: number;
61
- limit: number;
62
- total: number;
63
- };
64
- type FeedbackListResult = {
65
- feedbacks: Feedback[];
66
- meta: FeedbackListMeta;
67
- };
68
- type CreateFeedbackResult = {
69
- id: string;
70
- };
71
-
72
- /**
73
- * Brandapp Feedback client.
74
- *
75
- * Lets a Brandapp collect customer feedback and read back the feedback with
76
- * staff replies, so the external app can render a "내 피드백/답변" surface.
77
- * Collected feedback lands in the reopt Studio CRM feedback inbox where the
78
- * workspace staff triages it (reply / convert to task).
79
- *
80
- * Two credential paths:
81
- * - App credentials (Basic / service token) — `create`, `list`, `get`.
82
- * `list`/`get` are scoped to feedback this brandapp collected.
83
- * - End-user OAuth access token — `me.create`, `me.list`, `me.get`.
84
- * Scoped to the signed-in user's linked customer; `me.list` includes
85
- * feedback the same customer submitted through brand forms too.
86
- *
87
- * @example
88
- * ```ts
89
- * const sdk = createReoptSDK({ clientId, clientSecret, brandappId });
90
- *
91
- * // Server-side collection (attribute to a linked customer if known):
92
- * await sdk.feedback.create({ content: "배송이 늦어요", rating: 2, customerId });
93
- *
94
- * // Signed-in user surface (OAuth access token):
95
- * const { feedbacks } = await sdk.feedback.me.list(accessToken);
96
- * const detail = await sdk.feedback.me.get(feedbacks[0]!.id, accessToken);
97
- * detail.replies; // staff replies to render
98
- * ```
99
- */
100
-
101
- declare class ReoptFeedbackClient {
102
- private readonly http;
103
- constructor(config: ReoptSDKConfig);
104
- /**
105
- * Create a feedback with app credentials (server-to-server collection).
106
- * Pass `customerId` to attribute it to a customer linked to this brandapp.
107
- */
108
- create(input: CreateFeedbackInput): Promise<CreateFeedbackResult>;
109
- /** List feedback this brandapp collected (app credentials). */
110
- list(query?: ListFeedbackQuery): Promise<FeedbackListResult>;
111
- /** Fetch one feedback with its reply thread (app credentials). */
112
- get(feedbackId: string): Promise<FeedbackDetail>;
113
- /** End-user surface — requires the signed-in user's OAuth access token. */
114
- readonly me: {
115
- /**
116
- * Create a feedback as the signed-in user. The server resolves the
117
- * token's linked customer; unlinked users get 403 `LINK_REQUIRED`
118
- * (call `sdk.auth.linkCurrentUser` first).
119
- */
120
- create: (input: Omit<CreateFeedbackInput, "customerId">, accessToken: string) => Promise<CreateFeedbackResult>;
121
- /**
122
- * List the signed-in user's own feedback (all collection sources —
123
- * brand form submissions included).
124
- */
125
- list: (accessToken: string, query?: Omit<ListFeedbackQuery, "customerId">) => Promise<FeedbackListResult>;
126
- /** Fetch one of the signed-in user's feedback with staff replies. */
127
- get: (feedbackId: string, accessToken: string) => Promise<FeedbackDetail>;
128
- };
129
- }
130
- declare function createReoptFeedbackClient(config: ReoptSDKConfig): ReoptFeedbackClient;
131
-
132
- export { type CreateFeedbackInput, type CreateFeedbackResult, type Feedback, type FeedbackDetail, type FeedbackListMeta, type FeedbackListResult, type FeedbackReply, type FeedbackStatus, type ListFeedbackQuery, ReoptFeedbackClient, createReoptFeedbackClient };
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-BruP5_nU.js";
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 };
@@ -1,6 +1,3 @@
1
- export { ReoptFeedbackClient, createReoptFeedbackClient } from '../chunk-55KHY5GH.js';
2
- import '../chunk-YTKSAWV2.js';
3
- import '../chunk-2LSCQHAU.js';
4
- import '../chunk-C5VTRZWX.js';
5
- //# sourceMappingURL=index.js.map
6
- //# sourceMappingURL=index.js.map
1
+ import { n as createReoptFeedbackClient, t as ReoptFeedbackClient } from "../client-zF1RG2uA.js";
2
+
3
+ export { ReoptFeedbackClient, createReoptFeedbackClient };
@@ -1,6 +1,5 @@
1
- export { F as FileInfo, a as FileListQuery, b as FileListResponse, R as ReoptFileClient, U as UploadOptions, c as createReoptFileClient } from '../client-CN5_tNOC.js';
2
- import '../config-CtxyJsDR.js';
3
-
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-B7rZQ8Zi.js";
2
+ //#region src/files/helpers.d.ts
4
3
  /**
5
4
  * 이미지 URL 헬퍼 — Next.js `<Image>`와 결합해 사용.
6
5
  *
@@ -9,23 +8,23 @@ import '../config-CtxyJsDR.js';
9
8
  * (3) `remotePatterns` 설정용 호스트 목록을 제공한다.
10
9
  */
11
10
  type OptimizeUrlOptions = {
12
- /** 출력 너비(px). 미지정 시 query 추가하지 않음. */
13
- width?: number;
14
- /** 1-100 범위 quality. */
15
- quality?: number;
11
+ /** 출력 너비(px). 미지정 시 query 추가하지 않음. */
12
+ width?: number;
13
+ /** 1-100 범위 quality. */
14
+ quality?: number;
16
15
  };
17
16
  type ImageLoaderArgs = {
18
- src: string;
19
- width: number;
20
- quality?: number;
17
+ src: string;
18
+ width: number;
19
+ quality?: number;
21
20
  };
22
21
  /**
23
22
  * `next.config.ts`의 `images.remotePatterns`에 사용. Reopt가 호스팅하는
24
23
  * 이미지(Vercel Blob, future CDN)를 Next.js Image optimization이 가져갈 수 있게 등록.
25
24
  */
26
25
  type ImageRemotePattern = {
27
- protocol: "https";
28
- hostname: string;
26
+ protocol: "https";
27
+ hostname: string;
29
28
  };
30
29
  declare const REOPT_IMAGE_REMOTE_PATTERNS: ImageRemotePattern[];
31
30
  /**
@@ -50,5 +49,6 @@ declare function optimizeUrl(src: string, opts: OptimizeUrlOptions): string;
50
49
  * ```
51
50
  */
52
51
  declare function createImageLoader(defaults?: OptimizeUrlOptions): ({ src, width, quality }: ImageLoaderArgs) => string;
53
-
54
- export { type ImageLoaderArgs, type ImageRemotePattern, type OptimizeUrlOptions, REOPT_IMAGE_REMOTE_PATTERNS, createImageLoader, optimizeUrl };
52
+ //#endregion
53
+ export { type CreateFolderInput, type FileInfo, type FileListQuery, type FileListResponse, type FileUsageInfo, type FolderInfo, type FolderListQuery, type ImageLoaderArgs, type ImageRemotePattern, type OptimizeUrlOptions, REOPT_IMAGE_REMOTE_PATTERNS, ReoptFileClient, type UpdateFileInput, type UpdateFolderInput, type UploadOptions, createImageLoader, createReoptFileClient, optimizeUrl };
54
+ //# sourceMappingURL=index.d.ts.map
@@ -1,32 +1,48 @@
1
- export { ReoptFileClient, createReoptFileClient } from '../chunk-UGBBXCZE.js';
2
- import '../chunk-F7BXBTZI.js';
3
- import '../chunk-YTKSAWV2.js';
4
- import '../chunk-2LSCQHAU.js';
5
- import '../chunk-C5VTRZWX.js';
1
+ import { n as createReoptFileClient, t as ReoptFileClient } from "../client-BoIuyx4S.js";
6
2
 
7
- // src/files/helpers.ts
8
- var REOPT_IMAGE_REMOTE_PATTERNS = [
9
- { protocol: "https", hostname: "*.public.blob.vercel-storage.com" }
10
- ];
3
+ //#region src/files/helpers.ts
4
+ const REOPT_IMAGE_REMOTE_PATTERNS = [{
5
+ protocol: "https",
6
+ hostname: "*.public.blob.vercel-storage.com"
7
+ }];
8
+ /**
9
+ * src에 width / quality 쿼리를 추가. 잘못된 URL은 그대로 반환.
10
+ *
11
+ * Next.js Image가 자체 optimization endpoint(`/_next/image`)를 사용하므로
12
+ * 일반적으로는 이 함수를 직접 호출할 필요 없음 — Next.js가 알아서 처리한다.
13
+ * 정적 OG 이미지 등 외부 사용자가 직접 URL을 만들 때만 사용.
14
+ */
11
15
  function optimizeUrl(src, opts) {
12
- if (opts.width === void 0 && opts.quality === void 0) return src;
13
- try {
14
- const url = new URL(src);
15
- if (opts.width !== void 0) url.searchParams.set("w", String(opts.width));
16
- if (opts.quality !== void 0)
17
- url.searchParams.set("q", String(opts.quality));
18
- return url.toString();
19
- } catch {
20
- return src;
21
- }
16
+ if (opts.width === void 0 && opts.quality === void 0) return src;
17
+ try {
18
+ const url = new URL(src);
19
+ if (opts.width !== void 0) url.searchParams.set("w", String(opts.width));
20
+ if (opts.quality !== void 0) url.searchParams.set("q", String(opts.quality));
21
+ return url.toString();
22
+ } catch {
23
+ return src;
24
+ }
22
25
  }
26
+ /**
27
+ * Next.js Image `loader` prop과 호환되는 함수 반환. Next.js의 default loader
28
+ * (`/_next/image?url=...`) 대신 src 자체에 쿼리를 붙여 반환.
29
+ *
30
+ * @example
31
+ * ```tsx
32
+ * import Image from "next/image";
33
+ * import { createImageLoader } from "@reopt-ai/brandapp-sdk/files";
34
+ *
35
+ * const loader = createImageLoader({ quality: 80 });
36
+ * <Image loader={loader} src={url} width={1200} height={630} alt="" />;
37
+ * ```
38
+ */
23
39
  function createImageLoader(defaults) {
24
- return ({ src, width, quality }) => optimizeUrl(src, {
25
- width,
26
- quality: quality ?? defaults?.quality
27
- });
40
+ return ({ src, width, quality }) => optimizeUrl(src, {
41
+ width,
42
+ quality: quality ?? defaults?.quality
43
+ });
28
44
  }
29
45
 
30
- export { REOPT_IMAGE_REMOTE_PATTERNS, createImageLoader, optimizeUrl };
31
- //# sourceMappingURL=index.js.map
46
+ //#endregion
47
+ export { REOPT_IMAGE_REMOTE_PATTERNS, ReoptFileClient, createImageLoader, createReoptFileClient, optimizeUrl };
32
48
  //# sourceMappingURL=index.js.map