@reopt-ai/brandapp-sdk 4.0.0 → 4.1.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 +9 -0
- package/dist/ai/index.js +1 -1
- package/dist/ai-provider/index.js +1 -1
- package/dist/analytics/index.d.ts +22 -0
- package/dist/analytics/index.js +44 -0
- package/dist/auth/index.js +1 -1
- package/dist/better-auth/index.js +2 -2
- package/dist/client-2IaU8yUs.js +20 -0
- package/dist/{client-CAjqKz8i.js → client-CHp-oNJB.js} +3 -3
- package/dist/{client-D9MGqXbn.js → client-CP9RSAzn.js} +2 -2
- package/dist/{client-B0uRUF3T.js → client-CTefnLKY.js} +3 -3
- package/dist/{client-Djlg4STl.js → client-DE3FvPFs.js} +2 -2
- package/dist/client-DZu4msTG.d.ts +24 -0
- package/dist/{client-2qKKpHVy.js → client-D_7G37OB.js} +2 -2
- package/dist/{client-DUvf9x_b.js → client-Dnp7_J0-.js} +2 -2
- package/dist/{client-D72MLGRY.js → client-Dx3sYx7V.js} +4 -4
- package/dist/{client-DTWpLo8X.js → client-SwByFT8p.js} +2 -2
- package/dist/{client-C6USfykM.js → client-mvcEj1Vq.js} +3 -3
- package/dist/cms/index.js +1 -1
- package/dist/{config-D31PK7eu.js → config-tEsB7QhQ.js} +2 -2
- package/dist/eav/index.js +2 -2
- package/dist/feedback/index.js +1 -1
- package/dist/files/index.js +1 -1
- package/dist/{http-client-D1vuc20o.js → http-client-CCFmwnaQ.js} +2 -2
- package/dist/{index-CvNJ8zp1.d.ts → index-DJMr3ixA.d.ts} +3 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -11
- package/dist/logout/index.js +1 -1
- package/dist/plans/index.js +1 -1
- package/dist/push/index.js +1 -1
- package/dist/{query-DyiwJX92.js → query-Bsgb85OE.js} +2 -2
- package/dist/react/hooks.d.ts +1 -1
- package/dist/terms/index.js +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/package.json +11 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,15 @@ This project adheres to [Semantic Versioning](https://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [4.1.0] — 2026-08-24
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `sdk.analytics.getConfig()` + `@reopt-ai/brandapp-sdk/analytics` 서브패스
|
|
15
|
+
`startBrandappAnalytics(sdk)` — 브랜드의 reopt-data 수집 설정(`baseUrl`·`writeKey`)을
|
|
16
|
+
브랜드앱 자격으로 받아 `@reopt-ai/data-sdk`를 한 번에 초기화한다(RFC-0023).
|
|
17
|
+
`@reopt-ai/data-sdk`는 optional peer — 이 서브패스를 쓰는 소비자만 설치한다.
|
|
18
|
+
|
|
10
19
|
## [4.0.0] — 2026-08-21
|
|
11
20
|
|
|
12
21
|
Better Auth **1.7** 이행. 1.7이 generic OAuth를 소셜 제공자 경로로 재작성하고
|
package/dist/ai/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as mapHttpStatusToError, i as resolveBaseUrl, n as SDK_VERSION, o as validateConfig, r as assertBrowserSafe } from "../config-
|
|
1
|
+
import { A as mapHttpStatusToError, i as resolveBaseUrl, n as SDK_VERSION, o as validateConfig, r as assertBrowserSafe } from "../config-tEsB7QhQ.js";
|
|
2
2
|
import { t as createManagedAbort } from "../abort--nOBFN4M.js";
|
|
3
3
|
import { t as createAuthHeader } from "../encoding-Bwfm3iaE.js";
|
|
4
4
|
import { t as createSSELineProcessor } from "../sse-parser-FMjxM7sY.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { n as createReoptAnalyticsClient, r as AnalyticsConfig, t as ReoptAnalyticsClient } from "../client-DZu4msTG.js";
|
|
2
|
+
import { identify, pageView, setConsent, track } from "@reopt-ai/data-sdk";
|
|
3
|
+
//#region src/analytics/browser.d.ts
|
|
4
|
+
type BrandappAnalytics = {
|
|
5
|
+
track: typeof track;
|
|
6
|
+
identify: typeof identify;
|
|
7
|
+
pageView: typeof pageView;
|
|
8
|
+
setConsent: typeof setConsent;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Fetches the config and initialises the SDK. Returns `null` when analytics is
|
|
12
|
+
* not enabled for the brand (project not provisioned) — callers can `?.` every
|
|
13
|
+
* call and ship the same code either way.
|
|
14
|
+
*/
|
|
15
|
+
declare function startBrandappAnalytics(sdk: {
|
|
16
|
+
analytics: ReoptAnalyticsClient;
|
|
17
|
+
}, options?: {
|
|
18
|
+
accessToken?: string;
|
|
19
|
+
}): Promise<BrandappAnalytics | null>;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { type AnalyticsConfig, type BrandappAnalytics, ReoptAnalyticsClient, createReoptAnalyticsClient, startBrandappAnalytics };
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { n as createReoptAnalyticsClient, t as ReoptAnalyticsClient } from "../client-2IaU8yUs.js";
|
|
2
|
+
import { getInstance, identify, init, pageView, setConsent, track } from "@reopt-ai/data-sdk";
|
|
3
|
+
|
|
4
|
+
//#region src/analytics/browser.ts
|
|
5
|
+
/**
|
|
6
|
+
* Browser helper — wires `@reopt-ai/data-sdk` with the brand's collection config
|
|
7
|
+
* in one call, so a brandapp page needs no separate analytics credential.
|
|
8
|
+
*
|
|
9
|
+
* `@reopt-ai/data-sdk` is an optional peer dependency: import this module only
|
|
10
|
+
* from code that installs it.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { startBrandappAnalytics } from "@reopt-ai/brandapp-sdk/analytics";
|
|
15
|
+
*
|
|
16
|
+
* const analytics = await startBrandappAnalytics(sdk);
|
|
17
|
+
* analytics?.pageView();
|
|
18
|
+
* analytics?.track("signup_clicked", { plan: "pro" });
|
|
19
|
+
* analytics?.identify(customerId); // profileId = studio Customer.id
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Fetches the config and initialises the SDK. Returns `null` when analytics is
|
|
24
|
+
* not enabled for the brand (project not provisioned) — callers can `?.` every
|
|
25
|
+
* call and ship the same code either way.
|
|
26
|
+
*/
|
|
27
|
+
async function startBrandappAnalytics(sdk, options = {}) {
|
|
28
|
+
const config = await sdk.analytics.getConfig(options.accessToken);
|
|
29
|
+
if (!config.enabled) return null;
|
|
30
|
+
if (!getInstance()) init({
|
|
31
|
+
baseUrl: config.baseUrl,
|
|
32
|
+
writeKey: config.writeKey
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
track,
|
|
36
|
+
identify,
|
|
37
|
+
pageView,
|
|
38
|
+
setConsent
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
export { ReoptAnalyticsClient, createReoptAnalyticsClient, startBrandappAnalytics };
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
package/dist/auth/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ServerError, D as isReoptSDKError, a as resolveIdBaseUrl, b as RateLimitError, s as AuthError, t as REOPT_BASE_URLS, x as ReoptSDKError } from "../config-
|
|
2
|
-
import { t as BaseHttpClient } from "../http-client-
|
|
1
|
+
import { C as ServerError, D as isReoptSDKError, a as resolveIdBaseUrl, b as RateLimitError, s as AuthError, t as REOPT_BASE_URLS, x as ReoptSDKError } from "../config-tEsB7QhQ.js";
|
|
2
|
+
import { t as BaseHttpClient } from "../http-client-CCFmwnaQ.js";
|
|
3
3
|
import { n as REOPT_PROVIDER_ID, t as REOPT_DEFAULT_SCOPES } from "../types-DjDRszNj.js";
|
|
4
4
|
import { createAdapterFactory } from "better-auth/adapters";
|
|
5
5
|
import { genericOAuth } from "better-auth/plugins";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
|
|
2
|
+
|
|
3
|
+
//#region src/analytics/client.ts
|
|
4
|
+
var ReoptAnalyticsClient = class {
|
|
5
|
+
http;
|
|
6
|
+
constructor(config) {
|
|
7
|
+
this.http = new BaseHttpClient(config, `/api/v1/brandapp/${config.brandappId}/analytics`);
|
|
8
|
+
}
|
|
9
|
+
/** Basic or Bearer. `{ enabled: false }` until the brand's project is provisioned. */
|
|
10
|
+
async getConfig(accessToken) {
|
|
11
|
+
return (await this.http.fetch("GET", "/config", void 0, accessToken ? { bearerToken: accessToken } : void 0)).data;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
function createReoptAnalyticsClient(config) {
|
|
15
|
+
return new ReoptAnalyticsClient(config);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { createReoptAnalyticsClient as n, ReoptAnalyticsClient as t };
|
|
20
|
+
//# sourceMappingURL=client-2IaU8yUs.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
2
|
-
import { t as buildQuery } from "./query-
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
|
|
2
|
+
import { t as buildQuery } from "./query-Bsgb85OE.js";
|
|
3
3
|
|
|
4
4
|
//#region src/eav/cache.ts
|
|
5
5
|
var SchemaCache = class {
|
|
@@ -500,4 +500,4 @@ function createReoptEavClient(config) {
|
|
|
500
500
|
|
|
501
501
|
//#endregion
|
|
502
502
|
export { createReoptEavClient as t };
|
|
503
|
-
//# sourceMappingURL=client-
|
|
503
|
+
//# sourceMappingURL=client-CHp-oNJB.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
|
|
2
2
|
|
|
3
3
|
//#region src/auth/client.ts
|
|
4
4
|
function unwrap(body) {
|
|
@@ -50,4 +50,4 @@ function createReoptAuthClient(config) {
|
|
|
50
50
|
|
|
51
51
|
//#endregion
|
|
52
52
|
export { createReoptAuthClient as n, ReoptAuthClient as t };
|
|
53
|
-
//# sourceMappingURL=client-
|
|
53
|
+
//# sourceMappingURL=client-CP9RSAzn.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
2
|
-
import { t as buildQuery } from "./query-
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
|
|
2
|
+
import { t as buildQuery } from "./query-Bsgb85OE.js";
|
|
3
3
|
|
|
4
4
|
//#region src/cms/client.ts
|
|
5
5
|
function createReoptCmsClient(config) {
|
|
@@ -52,4 +52,4 @@ async list(query) {
|
|
|
52
52
|
|
|
53
53
|
//#endregion
|
|
54
54
|
export { createReoptCmsClient as t };
|
|
55
|
-
//# sourceMappingURL=client-
|
|
55
|
+
//# sourceMappingURL=client-CTefnLKY.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
|
|
2
2
|
|
|
3
3
|
//#region src/plans/client.ts
|
|
4
4
|
function unwrap(body) {
|
|
@@ -78,4 +78,4 @@ function createReoptPlansClient(config) {
|
|
|
78
78
|
|
|
79
79
|
//#endregion
|
|
80
80
|
export { createReoptPlansClient as n, ReoptPlansClient as t };
|
|
81
|
-
//# sourceMappingURL=client-
|
|
81
|
+
//# sourceMappingURL=client-DE3FvPFs.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { n as ReoptSDKConfig } from "./config-C7WQtC3l.js";
|
|
2
|
+
//#region src/analytics/types.d.ts
|
|
3
|
+
/** `GET /brandapp/{id}/analytics/config` — 브랜드의 reopt-data 브라우저 수집 설정. */
|
|
4
|
+
type AnalyticsConfig = {
|
|
5
|
+
enabled: false;
|
|
6
|
+
} | {
|
|
7
|
+
enabled: true;
|
|
8
|
+
/** reopt-data base URL — data-sdk `init({ baseUrl })`에 그대로. */
|
|
9
|
+
baseUrl: string;
|
|
10
|
+
/** 브라우저 수집 키(scopes ingest). 공개 값 — 읽기 권한이 없다. */
|
|
11
|
+
writeKey: string;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/analytics/client.d.ts
|
|
15
|
+
declare class ReoptAnalyticsClient {
|
|
16
|
+
private readonly http;
|
|
17
|
+
constructor(config: ReoptSDKConfig);
|
|
18
|
+
/** Basic or Bearer. `{ enabled: false }` until the brand's project is provisioned. */
|
|
19
|
+
getConfig(accessToken?: string): Promise<AnalyticsConfig>;
|
|
20
|
+
}
|
|
21
|
+
declare function createReoptAnalyticsClient(config: ReoptSDKConfig): ReoptAnalyticsClient;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { createReoptAnalyticsClient as n, AnalyticsConfig as r, ReoptAnalyticsClient as t };
|
|
24
|
+
//# sourceMappingURL=client-DZu4msTG.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
|
|
2
2
|
|
|
3
3
|
//#region src/push/client.ts
|
|
4
4
|
var ReoptPushClient = class {
|
|
@@ -25,4 +25,4 @@ function createReoptPushClient(config) {
|
|
|
25
25
|
|
|
26
26
|
//#endregion
|
|
27
27
|
export { createReoptPushClient as n, ReoptPushClient as t };
|
|
28
|
-
//# sourceMappingURL=client-
|
|
28
|
+
//# sourceMappingURL=client-D_7G37OB.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
|
|
2
2
|
|
|
3
3
|
//#region src/terms/client.ts
|
|
4
4
|
function unwrap(body) {
|
|
@@ -80,4 +80,4 @@ function createReoptTermsClient(config) {
|
|
|
80
80
|
|
|
81
81
|
//#endregion
|
|
82
82
|
export { createReoptTermsClient as n, ReoptTermsClient as t };
|
|
83
|
-
//# sourceMappingURL=client-
|
|
83
|
+
//# sourceMappingURL=client-Dnp7_J0-.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, x as ReoptSDKError } from "./config-
|
|
1
|
+
import { A as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, x as ReoptSDKError } from "./config-tEsB7QhQ.js";
|
|
2
2
|
import { t as createManagedAbort } from "./abort--nOBFN4M.js";
|
|
3
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
3
|
+
import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
|
|
4
4
|
import { n as parseSSEStream } from "./sse-parser-FMjxM7sY.js";
|
|
5
5
|
|
|
6
6
|
//#region src/ai/client.ts
|
|
@@ -224,7 +224,7 @@ var ReoptAiClient = class {
|
|
|
224
224
|
}
|
|
225
225
|
async fetchSSE(options) {
|
|
226
226
|
const url = `${this.http.requestBaseUrl}/chat/completions`;
|
|
227
|
-
const requestId = globalThis.crypto?.randomUUID?.() ?? `sdk-${"4.
|
|
227
|
+
const requestId = globalThis.crypto?.randomUUID?.() ?? `sdk-${"4.1.0"}-${url.length}`;
|
|
228
228
|
const ctx = {
|
|
229
229
|
method: "POST",
|
|
230
230
|
url,
|
|
@@ -302,4 +302,4 @@ function createReoptAiClient(config) {
|
|
|
302
302
|
|
|
303
303
|
//#endregion
|
|
304
304
|
export { createReoptAiClient as n, ReoptAiClient as t };
|
|
305
|
-
//# sourceMappingURL=client-
|
|
305
|
+
//# sourceMappingURL=client-Dx3sYx7V.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
|
|
2
2
|
|
|
3
3
|
//#region src/feedback/client.ts
|
|
4
4
|
function buildListQuery(query) {
|
|
@@ -83,4 +83,4 @@ function createReoptFeedbackClient(config) {
|
|
|
83
83
|
|
|
84
84
|
//#endregion
|
|
85
85
|
export { createReoptFeedbackClient as n, ReoptFeedbackClient as t };
|
|
86
|
-
//# sourceMappingURL=client-
|
|
86
|
+
//# sourceMappingURL=client-SwByFT8p.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, x as ReoptSDKError } from "./config-
|
|
1
|
+
import { A as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, x as ReoptSDKError } from "./config-tEsB7QhQ.js";
|
|
2
2
|
import { t as createManagedAbort } from "./abort--nOBFN4M.js";
|
|
3
|
-
import { n as parseFieldErrors, t as BaseHttpClient } from "./http-client-
|
|
3
|
+
import { n as parseFieldErrors, t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
|
|
4
4
|
|
|
5
5
|
//#region src/files/client.ts
|
|
6
6
|
var ReoptFileClient = class {
|
|
@@ -270,4 +270,4 @@ function createReoptFileClient(config) {
|
|
|
270
270
|
|
|
271
271
|
//#endregion
|
|
272
272
|
export { createReoptFileClient as n, ReoptFileClient as t };
|
|
273
|
-
//# sourceMappingURL=client-
|
|
273
|
+
//# sourceMappingURL=client-mvcEj1Vq.js.map
|
package/dist/cms/index.js
CHANGED
|
@@ -305,7 +305,7 @@ function mapHttpStatusToError(status, code, message, ctx, fieldErrors) {
|
|
|
305
305
|
|
|
306
306
|
//#endregion
|
|
307
307
|
//#region src/core/config.ts
|
|
308
|
-
const SDK_VERSION = "4.
|
|
308
|
+
const SDK_VERSION = "4.1.0";
|
|
309
309
|
/**
|
|
310
310
|
* Default API host for EAV / AI / Files / CMS / Terms. Consumers can override
|
|
311
311
|
* via `config.baseUrl` or the `REOPT_BASE_URL` env var.
|
|
@@ -484,4 +484,4 @@ function deriveIdFromBaseUrl(baseUrl) {
|
|
|
484
484
|
|
|
485
485
|
//#endregion
|
|
486
486
|
export { mapHttpStatusToError as A, ServerError as C, isReoptSDKError as D, isModelAccessError as E, isRequiredTermsError as O, RequiredTermsError as S, isCreditLimitError as T, ModelAccessError as _, resolveIdBaseUrl as a, RateLimitError as b, AuthUserNotFoundError as c, ConflictError as d, ContentFilterError as f, LimitExceededError as g, ForbiddenError as h, resolveBaseUrl as i, isValidationError as k, AuthUserRecordExistsError as l, DuplicateAuthUserError as m, SDK_VERSION as n, validateConfig as o, CreditLimitError as p, assertBrowserSafe as r, AuthError as s, REOPT_BASE_URLS as t, BadRequestError as u, ModelNotFoundError as v, ValidationError as w, ReoptSDKError as x, NotFoundError as y };
|
|
487
|
-
//# sourceMappingURL=config-
|
|
487
|
+
//# sourceMappingURL=config-tEsB7QhQ.js.map
|
package/dist/eav/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as AuthUserNotFoundError, g as LimitExceededError, l as AuthUserRecordExistsError, m as DuplicateAuthUserError } from "../config-
|
|
2
|
-
import { t as createReoptEavClient } from "../client-
|
|
1
|
+
import { c as AuthUserNotFoundError, g as LimitExceededError, l as AuthUserRecordExistsError, m as DuplicateAuthUserError } from "../config-tEsB7QhQ.js";
|
|
2
|
+
import { t as createReoptEavClient } from "../client-CHp-oNJB.js";
|
|
3
3
|
|
|
4
4
|
//#region src/eav/verify.ts
|
|
5
5
|
async function verifyEavSchema(input) {
|
package/dist/feedback/index.js
CHANGED
package/dist/files/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as mapHttpStatusToError, C as ServerError, a as resolveIdBaseUrl, b as RateLimitError, i as resolveBaseUrl, n as SDK_VERSION, o as validateConfig, x as ReoptSDKError } from "./config-
|
|
1
|
+
import { A as mapHttpStatusToError, C as ServerError, a as resolveIdBaseUrl, b as RateLimitError, i as resolveBaseUrl, n as SDK_VERSION, o as validateConfig, x as ReoptSDKError } from "./config-tEsB7QhQ.js";
|
|
2
2
|
import { t as createAuthHeader } from "./encoding-Bwfm3iaE.js";
|
|
3
3
|
|
|
4
4
|
//#region src/core/debug.ts
|
|
@@ -383,4 +383,4 @@ function parseFieldErrors(body) {
|
|
|
383
383
|
|
|
384
384
|
//#endregion
|
|
385
385
|
export { parseFieldErrors as n, BaseHttpClient as t };
|
|
386
|
-
//# sourceMappingURL=http-client-
|
|
386
|
+
//# sourceMappingURL=http-client-CCFmwnaQ.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { l as SchemaDef, n as ReoptSDKConfig } from "./config-C7WQtC3l.js";
|
|
2
2
|
import { t as ReoptAiClient } from "./client-DPbXH8tr.js";
|
|
3
|
+
import { t as ReoptAnalyticsClient } from "./client-DZu4msTG.js";
|
|
3
4
|
import { t as ReoptAuthClient } from "./client-yBQen4Yi.js";
|
|
4
5
|
import { t as ReoptCmsClient } from "./client-BTS6Ewv_.js";
|
|
5
6
|
import { t as ReoptEavClient } from "./client-CAGo56KO.js";
|
|
@@ -154,6 +155,7 @@ type ReoptSDK<S extends SchemaDef = SchemaDef> = {
|
|
|
154
155
|
debug: NonNullable<ReoptSDKConfig["debug"]>;
|
|
155
156
|
};
|
|
156
157
|
ai: ReoptAiClient;
|
|
158
|
+
analytics: ReoptAnalyticsClient;
|
|
157
159
|
auth: ReoptAuthClient;
|
|
158
160
|
cms: ReoptCmsClient;
|
|
159
161
|
eav: ReoptEavClient<S>;
|
|
@@ -166,4 +168,4 @@ type ReoptSDK<S extends SchemaDef = SchemaDef> = {
|
|
|
166
168
|
declare function createReoptSDK<S extends SchemaDef = SchemaDef>(config: ReoptSDKConfig<S>): ReoptSDK<S>;
|
|
167
169
|
//#endregion
|
|
168
170
|
export { initReoptSDK as a, getReoptSDK as i, createReoptSDK as n, resetSDK as o, createLazySDK as r, BaseHttpClient as s, ReoptSDK as t };
|
|
169
|
-
//# sourceMappingURL=index-
|
|
171
|
+
//# sourceMappingURL=index-DJMr3ixA.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import { a as DebugLogger, i as DebugLevel, n as ReoptSDKConfig, r as resolveBas
|
|
|
2
2
|
import { a as CompletionOptions, c as FinishReason, d as MessageRole, f as ModelInfo, i as ChatMessage, l as ImageGenerateOptions, m as StreamEvent, o as CompletionResult, p as StreamDoneData, r as AgentInfo, s as CreditInfo, u as ImageGenerateResult } from "./client-DPbXH8tr.js";
|
|
3
3
|
import { C as isModelAccessError, D as mapHttpStatusToError, E as isValidationError, S as isCreditLimitError, T as isRequiredTermsError, _ as ReoptSDKError, a as ConflictError, b as ServerError, c as DuplicateAuthUserError, d as ForbiddenError, f as LimitExceededError, g as RateLimitError, h as NotFoundError, i as BadRequestError, l as ErrorDiagnostic, m as ModelNotFoundError, n as AuthUserNotFoundError, o as ContentFilterError, p as ModelAccessError, r as AuthUserRecordExistsError, s as CreditLimitError, t as AuthError, u as FieldError, v as ReoptSDKErrorContext, w as isReoptSDKError, x as ValidationError, y as RequiredTermsError } from "./errors-CRCcErNC.js";
|
|
4
4
|
import { i as TypedEavRecord, r as EntityClient } from "./client-CAGo56KO.js";
|
|
5
|
-
import { a as initReoptSDK, i as getReoptSDK, n as createReoptSDK, o as resetSDK, r as createLazySDK, s as BaseHttpClient, t as ReoptSDK } from "./index-
|
|
5
|
+
import { a as initReoptSDK, i as getReoptSDK, n as createReoptSDK, o as resetSDK, r as createLazySDK, s as BaseHttpClient, t as ReoptSDK } from "./index-DJMr3ixA.js";
|
|
6
6
|
export { type AgentInfo, AuthError, AuthUserNotFoundError, AuthUserRecordExistsError, BadRequestError, BaseHttpClient, type ChatMessage, type CompletionOptions, type CompletionResult, ConflictError, ContentFilterError, type CreditInfo, CreditLimitError, type DebugLevel, type DebugLogger, DuplicateAuthUserError, type EntityClient, type ErrorDiagnostic, type FieldError, type FinishReason, ForbiddenError, type ImageGenerateOptions, type ImageGenerateResult, LimitExceededError, type MessageRole, ModelAccessError, type ModelInfo, ModelNotFoundError, NotFoundError, REOPT_BASE_URLS, RateLimitError, ReoptSDK, type ReoptSDKConfig, ReoptSDKError, type ReoptSDKErrorContext, RequiredTermsError, ServerError, type StreamDoneData, type StreamEvent, type TypedEavRecord, ValidationError, createLazySDK, createReoptSDK, getReoptSDK, initReoptSDK, isCreditLimitError, isModelAccessError, isReoptSDKError, isRequiredTermsError, isValidationError, mapHttpStatusToError, resetSDK, resolveBaseUrl };
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { A as mapHttpStatusToError, C as ServerError, D as isReoptSDKError, E as isModelAccessError, O as isRequiredTermsError, S as RequiredTermsError, T as isCreditLimitError, _ as ModelAccessError, b as RateLimitError, c as AuthUserNotFoundError, d as ConflictError, f as ContentFilterError, g as LimitExceededError, h as ForbiddenError, i as resolveBaseUrl, k as isValidationError, 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 ValidationError, x as ReoptSDKError, y as NotFoundError } from "./config-
|
|
2
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
3
|
-
import { n as createReoptAiClient } from "./client-
|
|
4
|
-
import { n as createReoptAuthClient } from "./client-
|
|
5
|
-
import { t as createReoptCmsClient } from "./client-
|
|
6
|
-
import { t as createReoptEavClient } from "./client-
|
|
7
|
-
import { n as createReoptFeedbackClient } from "./client-
|
|
8
|
-
import { n as createReoptFileClient } from "./client-
|
|
9
|
-
import { n as
|
|
10
|
-
import { n as
|
|
11
|
-
import { n as
|
|
1
|
+
import { A as mapHttpStatusToError, C as ServerError, D as isReoptSDKError, E as isModelAccessError, O as isRequiredTermsError, S as RequiredTermsError, T as isCreditLimitError, _ as ModelAccessError, b as RateLimitError, c as AuthUserNotFoundError, d as ConflictError, f as ContentFilterError, g as LimitExceededError, h as ForbiddenError, i as resolveBaseUrl, k as isValidationError, 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 ValidationError, x as ReoptSDKError, y as NotFoundError } from "./config-tEsB7QhQ.js";
|
|
2
|
+
import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
|
|
3
|
+
import { n as createReoptAiClient } from "./client-Dx3sYx7V.js";
|
|
4
|
+
import { n as createReoptAuthClient } from "./client-CP9RSAzn.js";
|
|
5
|
+
import { t as createReoptCmsClient } from "./client-CTefnLKY.js";
|
|
6
|
+
import { t as createReoptEavClient } from "./client-CHp-oNJB.js";
|
|
7
|
+
import { n as createReoptFeedbackClient } from "./client-SwByFT8p.js";
|
|
8
|
+
import { n as createReoptFileClient } from "./client-mvcEj1Vq.js";
|
|
9
|
+
import { n as createReoptAnalyticsClient } from "./client-2IaU8yUs.js";
|
|
10
|
+
import { n as createReoptPlansClient } from "./client-DE3FvPFs.js";
|
|
11
|
+
import { n as createReoptPushClient } from "./client-D_7G37OB.js";
|
|
12
|
+
import { n as createReoptTermsClient } from "./client-Dnp7_J0-.js";
|
|
12
13
|
|
|
13
14
|
//#region src/singleton.ts
|
|
14
15
|
let _instance;
|
|
@@ -117,6 +118,7 @@ function createReoptSDK(config) {
|
|
|
117
118
|
debug: config.debug ?? false
|
|
118
119
|
},
|
|
119
120
|
ai: createReoptAiClient(config),
|
|
121
|
+
analytics: createReoptAnalyticsClient(config),
|
|
120
122
|
auth: createReoptAuthClient(config),
|
|
121
123
|
cms: createReoptCmsClient(config),
|
|
122
124
|
eav: createReoptEavClient(config),
|
package/dist/logout/index.js
CHANGED
package/dist/plans/index.js
CHANGED
package/dist/push/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { x as ReoptSDKError } from "./config-
|
|
1
|
+
import { x as ReoptSDKError } from "./config-tEsB7QhQ.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-
|
|
35
|
+
//# sourceMappingURL=query-Bsgb85OE.js.map
|
package/dist/react/hooks.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { a as CompletionOptions, f as ModelInfo, l as ImageGenerateOptions, o as
|
|
|
3
3
|
import { _ as ReoptSDKError } from "../errors-CRCcErNC.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
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-A4YrHjDc.js";
|
|
6
|
-
import { t as ReoptSDK } from "../index-
|
|
6
|
+
import { t as ReoptSDK } from "../index-DJMr3ixA.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 = {
|
package/dist/terms/index.js
CHANGED
package/dist/testing/index.d.ts
CHANGED
|
@@ -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-DV_OWwx5.js";
|
|
2
|
-
import { t as ReoptSDK } from "../index-
|
|
2
|
+
import { t as ReoptSDK } from "../index-DJMr3ixA.js";
|
|
3
3
|
//#region src/testing/index.d.ts
|
|
4
4
|
type TestSDKOptions = {
|
|
5
5
|
/** EAV schema to seed entities and attributes */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reopt-ai/brandapp-sdk",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Reopt Brandapp SDK — Better Auth adapter, OAuth login, and EAV client",
|
|
5
5
|
"author": "Reopt",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
"types": "./dist/ai-provider/index.d.ts",
|
|
22
22
|
"import": "./dist/ai-provider/index.js"
|
|
23
23
|
},
|
|
24
|
+
"./analytics": {
|
|
25
|
+
"types": "./dist/analytics/index.d.ts",
|
|
26
|
+
"import": "./dist/analytics/index.js"
|
|
27
|
+
},
|
|
24
28
|
"./auth": {
|
|
25
29
|
"types": "./dist/auth/index.d.ts",
|
|
26
30
|
"import": "./dist/auth/index.js"
|
|
@@ -113,7 +117,8 @@
|
|
|
113
117
|
"@tanstack/react-query": ">=5.0.0",
|
|
114
118
|
"better-auth": "^1.7.1",
|
|
115
119
|
"hono": ">=4.0.0",
|
|
116
|
-
"react": ">=18.0.0"
|
|
120
|
+
"react": ">=18.0.0",
|
|
121
|
+
"@reopt-ai/data-sdk": ">=0.1.1"
|
|
117
122
|
},
|
|
118
123
|
"peerDependenciesMeta": {
|
|
119
124
|
"@ai-sdk/provider": {
|
|
@@ -133,6 +138,9 @@
|
|
|
133
138
|
},
|
|
134
139
|
"react": {
|
|
135
140
|
"optional": true
|
|
141
|
+
},
|
|
142
|
+
"@reopt-ai/data-sdk": {
|
|
143
|
+
"optional": true
|
|
136
144
|
}
|
|
137
145
|
},
|
|
138
146
|
"devDependencies": {
|
|
@@ -146,6 +154,7 @@
|
|
|
146
154
|
"tsdown": "^0.22.14",
|
|
147
155
|
"typescript": "^7",
|
|
148
156
|
"vitest": "^4.1.2",
|
|
157
|
+
"@reopt-ai/data-sdk": "^0.1.1",
|
|
149
158
|
"@reopt/typescript-config": "0.0.0"
|
|
150
159
|
},
|
|
151
160
|
"keywords": [
|