@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.
- package/CHANGELOG.md +67 -0
- package/README.md +10 -1
- package/dist/abort--nOBFN4M.js +50 -0
- package/dist/ai/index.d.ts +2 -314
- package/dist/ai/index.js +3 -8
- package/dist/ai-provider/index.d.ts +79 -163
- package/dist/ai-provider/index.js +752 -685
- package/dist/auth/index.d.ts +27 -27
- package/dist/auth/index.js +41 -34
- package/dist/better-auth/client.d.ts +6 -5
- package/dist/better-auth/client.js +28 -5
- package/dist/better-auth/index.d.ts +19 -17
- package/dist/better-auth/index.js +180 -144
- package/dist/client-B1q5P8rv.js +83 -0
- package/dist/client-B9QHVhdM.js +77 -0
- package/dist/client-BGGd_cpV.d.ts +103 -0
- package/dist/client-BJcy1V1a.js +140 -0
- package/dist/client-Beivhucf.js +55 -0
- package/dist/client-BruP5_nU.d.ts +147 -0
- package/dist/client-D-yNxNfk.js +28 -0
- package/dist/client-D0eBxh8j.d.ts +284 -0
- package/dist/client-D3RHHUUW.d.ts +207 -0
- package/dist/client-D6gs61w8.d.ts +53 -0
- package/dist/client-DBnK7ooQ.js +86 -0
- package/dist/client-DDw5yz_h.d.ts +53 -0
- package/dist/client-DPmoKuR9.js +305 -0
- package/dist/client-DsdakibF.js +503 -0
- package/dist/client-Dxg8_DIH.d.ts +71 -0
- package/dist/client-EbhUIhHq.js +53 -0
- package/dist/client-lk6wBu_0.d.ts +48 -0
- package/dist/client-p49ol9pg.d.ts +124 -0
- package/dist/cms/index.d.ts +52 -108
- package/dist/cms/index.js +103 -86
- package/dist/config-CRytOPPl.d.ts +394 -0
- package/dist/config-Cw0a3-C8.js +487 -0
- package/dist/dev/index.d.ts +2 -528
- package/dist/dev/index.js +2731 -2967
- package/dist/eav/coerce.d.ts +3 -1
- package/dist/eav/coerce.js +72 -46
- package/dist/eav/index.d.ts +72 -100
- package/dist/eav/index.js +158 -126
- package/dist/eav/migrate.d.ts +112 -109
- package/dist/eav/migrate.js +230 -196
- package/dist/eav/schema.d.ts +111 -150
- package/dist/eav/schema.js +624 -603
- package/dist/encoding-Bwfm3iaE.js +21 -0
- package/dist/{errors-BjDFIyA6.d.ts → errors-CRCcErNC.d.ts} +55 -53
- package/dist/feedback/index.d.ts +2 -132
- package/dist/feedback/index.js +3 -6
- package/dist/files/index.d.ts +14 -14
- package/dist/files/index.js +41 -25
- package/dist/http-client-QKUvvirs.js +386 -0
- package/dist/index-DrVaKfhs.d.ts +456 -0
- package/dist/index-Z6OGcurJ.d.ts +169 -0
- package/dist/index.d.ts +6 -230
- package/dist/index.js +119 -71
- package/dist/logout/index.d.ts +56 -53
- package/dist/logout/index.js +232 -289
- package/dist/plans/index.d.ts +2 -236
- package/dist/plans/index.js +3 -6
- package/dist/push/index.d.ts +2 -79
- package/dist/push/index.js +3 -6
- package/dist/query-BvbCiGWb.js +35 -0
- package/dist/react/hooks.d.ts +97 -99
- package/dist/react/hooks.js +742 -404
- package/dist/sse-parser-FMjxM7sY.js +86 -0
- package/dist/terms/index.d.ts +3 -79
- package/dist/terms/index.js +3 -6
- package/dist/testing/index.d.ts +52 -104
- package/dist/testing/index.js +94 -72
- package/dist/types-B-SMkH6s.d.ts +26 -0
- package/dist/types-BXDcoJHG.d.ts +131 -0
- package/dist/types-BrghN2rJ.d.ts +105 -0
- package/dist/types-DjDRszNj.js +11 -0
- package/dist/webhooks/index.d.ts +77 -50
- package/dist/webhooks/index.js +150 -127
- package/docs/api-reference.md +87 -6
- package/package.json +6 -5
- package/dist/chunk-2LSCQHAU.js +0 -21
- package/dist/chunk-4U4ZPPL4.js +0 -599
- package/dist/chunk-55KHY5GH.js +0 -96
- package/dist/chunk-C5VTRZWX.js +0 -458
- package/dist/chunk-F7BXBTZI.js +0 -54
- package/dist/chunk-FJUCWXX3.js +0 -350
- package/dist/chunk-H33OTQEN.js +0 -112
- package/dist/chunk-L4DHB36G.js +0 -75
- package/dist/chunk-OG7R3UAR.js +0 -105
- package/dist/chunk-PF24XU54.js +0 -32
- package/dist/chunk-QN3QD67K.js +0 -49
- package/dist/chunk-REIKXSMY.js +0 -7
- package/dist/chunk-UGBBXCZE.js +0 -157
- package/dist/chunk-UVT2E6KD.js +0 -81
- package/dist/chunk-YPLT3RFL.js +0 -63
- package/dist/chunk-YTKSAWV2.js +0 -463
- package/dist/client-BkcO-0C2.d.ts +0 -216
- package/dist/client-CN5_tNOC.d.ts +0 -147
- package/dist/client-DttyeM_h.d.ts +0 -102
- package/dist/config-CtxyJsDR.d.ts +0 -397
- package/dist/typed-client-BxOVIiMU.d.ts +0 -40
- package/dist/types-6E3ZLL9X.d.ts +0 -24
- package/dist/types-DskYLVb8.d.ts +0 -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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
32
|
+
constructor(message?: string, context?: ReoptSDKErrorContext);
|
|
32
33
|
}
|
|
33
34
|
declare class RateLimitError extends ReoptSDKError {
|
|
34
|
-
|
|
35
|
+
constructor(message?: string, retryAfterMs?: number, context?: ReoptSDKErrorContext);
|
|
35
36
|
}
|
|
36
37
|
declare class ServerError extends ReoptSDKError {
|
|
37
|
-
|
|
38
|
+
constructor(message?: string, context?: ReoptSDKErrorContext);
|
|
38
39
|
}
|
|
39
40
|
/** AI 크레딧 잔액 부족 (HTTP 402). */
|
|
40
41
|
declare class CreditLimitError extends ReoptSDKError {
|
|
41
|
-
|
|
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
|
-
|
|
49
|
+
constructor(message?: string, context?: ReoptSDKErrorContext);
|
|
49
50
|
}
|
|
50
51
|
/** 알 수 없는 모델 ID (HTTP 404, `MODEL_NOT_FOUND`). */
|
|
51
52
|
declare class ModelNotFoundError extends ReoptSDKError {
|
|
52
|
-
|
|
53
|
+
constructor(message?: string, context?: ReoptSDKErrorContext);
|
|
53
54
|
}
|
|
54
55
|
/** 콘텐츠 정책 위반으로 생성 거부 (HTTP 422, `CONTENT_FILTER`). */
|
|
55
56
|
declare class ContentFilterError extends ReoptSDKError {
|
|
56
|
-
|
|
57
|
+
constructor(message?: string, context?: ReoptSDKErrorContext);
|
|
57
58
|
}
|
|
58
59
|
declare class BadRequestError extends ReoptSDKError {
|
|
59
|
-
|
|
60
|
+
constructor(message?: string, context?: ReoptSDKErrorContext, code?: string);
|
|
60
61
|
}
|
|
61
62
|
declare class ForbiddenError extends ReoptSDKError {
|
|
62
|
-
|
|
63
|
+
constructor(message?: string, context?: ReoptSDKErrorContext, code?: string);
|
|
63
64
|
}
|
|
64
65
|
declare class NotFoundError extends ReoptSDKError {
|
|
65
|
-
|
|
66
|
+
constructor(message?: string, context?: ReoptSDKErrorContext, code?: string);
|
|
66
67
|
}
|
|
67
68
|
declare class ConflictError extends ReoptSDKError {
|
|
68
|
-
|
|
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
|
-
|
|
73
|
+
constructor(message?: string, context?: ReoptSDKErrorContext);
|
|
73
74
|
}
|
|
74
75
|
/** bulk create 입력에 같은 authUserId가 중복으로 등장 (1:1 메타 위반). */
|
|
75
76
|
declare class DuplicateAuthUserError extends ConflictError {
|
|
76
|
-
|
|
77
|
+
constructor(message?: string, context?: ReoptSDKErrorContext);
|
|
77
78
|
}
|
|
78
79
|
/** 참조한 brandappAuthUser가 이 brandapp에 존재하지 않음. status는 호출 경로에 따라 400 또는 422. */
|
|
79
80
|
declare class AuthUserNotFoundError extends ReoptSDKError {
|
|
80
|
-
|
|
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
|
-
|
|
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
|
-
|
|
110
|
-
|
|
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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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 {
|
|
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
|
package/dist/feedback/index.d.ts
CHANGED
|
@@ -1,132 +1,2 @@
|
|
|
1
|
-
import {
|
|
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 };
|
package/dist/feedback/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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-DBnK7ooQ.js";
|
|
2
|
+
|
|
3
|
+
export { ReoptFeedbackClient, createReoptFeedbackClient };
|
package/dist/files/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { a as FileListResponse, i as FileListQuery, n as createReoptFileClient, o as UploadOptions, r as FileInfo, t as ReoptFileClient } from "../client-p49ol9pg.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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
/** 출력 너비(px). 미지정 시 query 추가하지 않음. */
|
|
12
|
+
width?: number;
|
|
13
|
+
/** 1-100 범위 quality. */
|
|
14
|
+
quality?: number;
|
|
16
15
|
};
|
|
17
16
|
type ImageLoaderArgs = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
28
|
-
|
|
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 FileInfo, type FileListQuery, type FileListResponse, type ImageLoaderArgs, type ImageRemotePattern, type OptimizeUrlOptions, REOPT_IMAGE_REMOTE_PATTERNS, ReoptFileClient, type UploadOptions, createImageLoader, createReoptFileClient, optimizeUrl };
|
|
54
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/files/index.js
CHANGED
|
@@ -1,32 +1,48 @@
|
|
|
1
|
-
|
|
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-BJcy1V1a.js";
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
40
|
+
return ({ src, width, quality }) => optimizeUrl(src, {
|
|
41
|
+
width,
|
|
42
|
+
quality: quality ?? defaults?.quality
|
|
43
|
+
});
|
|
28
44
|
}
|
|
29
45
|
|
|
30
|
-
|
|
31
|
-
|
|
46
|
+
//#endregion
|
|
47
|
+
export { REOPT_IMAGE_REMOTE_PATTERNS, ReoptFileClient, createImageLoader, createReoptFileClient, optimizeUrl };
|
|
32
48
|
//# sourceMappingURL=index.js.map
|