@reopt-ai/brandapp-sdk 4.7.0-rc.4 → 4.7.0-rc.5
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 +20 -0
- package/dist/ai/index.js +1 -1
- package/dist/ai-provider/index.js +1 -1
- package/dist/analytics/index.js +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/better-auth/index.d.ts +1 -1
- package/dist/better-auth/index.js +2 -2
- package/dist/{client-BojYI4jP.js → client-B1oQZrBf.js} +4 -4
- package/dist/{client-BPLSaCrs.js → client-BEcJrDub.js} +4 -4
- package/dist/{client-GSy6AKsZ.js → client-BR4DzwcK.js} +2 -2
- package/dist/{client-BIO9amcp.js → client-C0WZeTm5.js} +2 -2
- package/dist/{client-DrxN768l.js → client-CW4dDKUa.js} +3 -3
- package/dist/{client-BO7-GuXP.d.ts → client-C_X-hkb_.d.ts} +28 -4
- package/dist/{client-CD8WQsmF.js → client-DDouTFSX.js} +2 -2
- package/dist/{client-DTFxSfCG.js → client-DbZHZJXf.js} +3 -3
- package/dist/{client-CQmuEZik.js → client-DkHxtSK1.js} +2 -2
- package/dist/{client-ZmjLpkjt.js → client-DlKJi-nP.js} +28 -2
- package/dist/{client-Cj92U3fu.js → client-DwwSQGMw.js} +2 -2
- package/dist/{client-ywlujscY.js → client-Dx3RjILO.js} +2 -2
- package/dist/{client-DAyfkqrY.js → client-_fMnz8Ot.js} +3 -3
- package/dist/cms/index.js +1 -1
- package/dist/{config-DKINyq4g.js → config-CasmvpPc.js} +8 -5
- package/dist/eav/index.d.ts +1 -1
- package/dist/eav/index.js +2 -2
- package/dist/{errors-U3TsyWVq.d.ts → errors-D-Va8oeC.d.ts} +5 -2
- package/dist/feedback/index.js +1 -1
- package/dist/files/index.js +1 -1
- package/dist/{http-client-aggnrSsb.js → http-client-D9GG3dtH.js} +2 -2
- package/dist/{index-CiZ5VkDS.d.ts → index-B2Jh3WzX.d.ts} +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -12
- package/dist/installation/index.js +3 -3
- package/dist/logout/index.js +1 -1
- package/dist/machine/index.js +1 -1
- package/dist/plans/index.d.ts +1 -1
- package/dist/plans/index.js +1 -1
- package/dist/push/index.js +1 -1
- package/dist/{query-BFqEr2OW.js → query-DVNclHZU.js} +2 -2
- package/dist/react/hooks.d.ts +2 -2
- package/dist/terms/index.js +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/workspace/index.js +1 -1
- package/docs/api-reference.md +11 -0
- package/docs/errors.md +21 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,26 @@ This project adheres to [Semantic Versioning](https://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [4.7.0-rc.5] — 2026-10-14
|
|
11
|
+
|
|
12
|
+
Pre-release (`npm i @reopt-ai/brandapp-sdk@next`) — 구독 중 플랜 변경(`plans.changePlan`)과 Lemon Squeezy 해지 계약, 5xx 오류 코드 보존.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- `plans.changePlan(planId, accessToken)` — 구독 중인 플랜을 바꾼다(`POST /me/subscription/change`).
|
|
17
|
+
새 체크아웃 없이 결제사 구독의 가격을 그 자리에서 바꾸므로 구독은 하나이고 갱신일이 이어진다.
|
|
18
|
+
즉시 적용되고 바뀐 플랜(`getMyPlan`과 같은 모양)을 돌려준다. 올리면 차액을 지금 청구하고 내리면
|
|
19
|
+
다음 청구서에서 차감한다. Lemon Squeezy 구독만 지원한다.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- 5xx 오류가 서버가 준 코드와 실제 상태를 담는다 — 상류(결제사) 실패는 `ServerError`이면서 `code`가
|
|
24
|
+
`PROVIDER_ERROR`·`PROVIDER_CANCEL_FAILED`, `status`가 502다. 코드 없는 5xx는 예전처럼 `SERVER_ERROR`이고
|
|
25
|
+
`status`는 실제 응답 상태다(전에는 항상 500).
|
|
26
|
+
- `plans.cancel` — Lemon Squeezy 구독은 결제사 해지가 먼저다. 결제사 해지가 실패하면 아무것도 바뀌지
|
|
27
|
+
않고 `PROVIDER_CANCEL_FAILED`(HTTP 502)로 실패한다 — 다시 시도하면 된다. 성공하면 `accessUntil`이
|
|
28
|
+
결제사의 결제 기간 끝이다.
|
|
29
|
+
|
|
10
30
|
## [4.7.0-rc.4] — 2026-10-14
|
|
11
31
|
|
|
12
32
|
Pre-release (`npm i @reopt-ai/brandapp-sdk@next`) — EAV `listAll()` 커서 훑기와 설치 back-channel 재생 거절 보강.
|
package/dist/ai/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as resolveBaseUrl, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, r as assertBrowserSafe } from "../config-
|
|
1
|
+
import { i as resolveBaseUrl, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, r as assertBrowserSafe } from "../config-CasmvpPc.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";
|
package/dist/analytics/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as createReoptAnalyticsClient, t as ReoptAnalyticsClient } from "../client-
|
|
1
|
+
import { n as createReoptAnalyticsClient, t as ReoptAnalyticsClient } from "../client-Dx3RjILO.js";
|
|
2
2
|
import { getInstance, identify, init, pageView, setConsent, track } from "@reopt-ai/data-sdk";
|
|
3
3
|
|
|
4
4
|
//#region src/analytics/browser.ts
|
package/dist/auth/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as ReoptSDKConfig, t as REOPT_BASE_URLS } from "../config-BGT9h1OW.js";
|
|
2
2
|
import { a as REOPT_PROVIDER_IDS, i as REOPT_PROVIDER_ID, n as AdapterRequestBody, o as REOPT_STEP_UP_PROVIDER_ID, r as REOPT_DEFAULT_SCOPES, s as STEP_UP_MAX_AUTH_AGE_SECONDS, t as AdapterOperation } from "../types-FazBnzhg.js";
|
|
3
3
|
import { i as ClientPrivateJwk } from "../keys-B2pA8EkU.js";
|
|
4
|
-
import { T as isReoptSDKError, _ as RateLimitError, t as AuthError, v as ReoptSDKError, x as ServerError } from "../errors-
|
|
4
|
+
import { T as isReoptSDKError, _ as RateLimitError, t as AuthError, v as ReoptSDKError, x as ServerError } from "../errors-D-Va8oeC.js";
|
|
5
5
|
import { AdapterFactory } from "better-auth/adapters";
|
|
6
6
|
import { BetterAuthOptions, BetterAuthPlugin } from "better-auth";
|
|
7
7
|
//#region src/better-auth/adapter.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as isReoptSDKError, S as ReoptSDKError, a as resolveIdBaseUrl, s as AuthError, t as REOPT_BASE_URLS, w as ServerError, x as RateLimitError } from "../config-
|
|
2
|
-
import { t as BaseHttpClient } from "../http-client-
|
|
1
|
+
import { O as isReoptSDKError, S as ReoptSDKError, a as resolveIdBaseUrl, s as AuthError, t as REOPT_BASE_URLS, w as ServerError, x as RateLimitError } from "../config-CasmvpPc.js";
|
|
2
|
+
import { t as BaseHttpClient } from "../http-client-D9GG3dtH.js";
|
|
3
3
|
import { o as readClientKeyRing } from "../keys-B_R_lsyF.js";
|
|
4
4
|
import { a as STEP_UP_MAX_AUTH_AGE_SECONDS, i as REOPT_STEP_UP_PROVIDER_ID, n as REOPT_PROVIDER_ID, r as REOPT_PROVIDER_IDS, t as REOPT_DEFAULT_SCOPES } from "../types-DGAVaUCc.js";
|
|
5
5
|
import { createAdapterFactory } from "better-auth/adapters";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ReoptSDKError, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig } from "./config-
|
|
1
|
+
import { S as ReoptSDKError, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig } from "./config-CasmvpPc.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-D9GG3dtH.js";
|
|
4
4
|
import { n as parseSSEStream } from "./sse-parser-FMjxM7sY.js";
|
|
5
5
|
|
|
6
6
|
//#region src/ai/client.ts
|
|
@@ -231,7 +231,7 @@ var ReoptAiClient = class {
|
|
|
231
231
|
}
|
|
232
232
|
async fetchSSE(options) {
|
|
233
233
|
const url = `${this.http.requestBaseUrl}/chat/completions`;
|
|
234
|
-
const requestId = globalThis.crypto?.randomUUID?.() ?? `sdk-${"4.7.0-rc.
|
|
234
|
+
const requestId = globalThis.crypto?.randomUUID?.() ?? `sdk-${"4.7.0-rc.5"}-${url.length}`;
|
|
235
235
|
const ctx = {
|
|
236
236
|
method: "POST",
|
|
237
237
|
url,
|
|
@@ -309,4 +309,4 @@ function createReoptAiClient(config) {
|
|
|
309
309
|
|
|
310
310
|
//#endregion
|
|
311
311
|
export { createReoptAiClient as n, ReoptAiClient as t };
|
|
312
|
-
//# sourceMappingURL=client-
|
|
312
|
+
//# sourceMappingURL=client-B1oQZrBf.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ReoptSDKError, u as BadRequestError } from "./config-
|
|
2
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
3
|
-
import { t as buildQuery } from "./query-
|
|
1
|
+
import { S as ReoptSDKError, u as BadRequestError } from "./config-CasmvpPc.js";
|
|
2
|
+
import { t as BaseHttpClient } from "./http-client-D9GG3dtH.js";
|
|
3
|
+
import { t as buildQuery } from "./query-DVNclHZU.js";
|
|
4
4
|
|
|
5
5
|
//#region src/eav/cache.ts
|
|
6
6
|
var SchemaCache = class {
|
|
@@ -603,4 +603,4 @@ function createReoptEavClient(config) {
|
|
|
603
603
|
|
|
604
604
|
//#endregion
|
|
605
605
|
export { RECORDS_PAGE_LIMIT_MAX as i, ATTRIBUTE_FILTER_LIST_MAX as n, ATTRIBUTE_FILTER_OPERATORS as r, createReoptEavClient as t };
|
|
606
|
-
//# sourceMappingURL=client-
|
|
606
|
+
//# sourceMappingURL=client-BEcJrDub.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-D9GG3dtH.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-BR4DzwcK.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-D9GG3dtH.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-C0WZeTm5.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-D9GG3dtH.js";
|
|
2
|
+
import { t as buildQuery } from "./query-DVNclHZU.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-CW4dDKUa.js.map
|
|
@@ -96,7 +96,7 @@ type CheckoutSession = {
|
|
|
96
96
|
* `getCheckout` 응답에서는 `null`이다(capability token 재노출 방지).
|
|
97
97
|
*/
|
|
98
98
|
checkoutUrl: string | null;
|
|
99
|
-
/** 결제 제공자 —
|
|
99
|
+
/** 결제 제공자 — "sandbox"(가상 결제) 또는 "lemonsqueezy"(실 결제, id 주문 확인 화면을 거친다). */
|
|
100
100
|
provider: string;
|
|
101
101
|
status: CheckoutStatus | string;
|
|
102
102
|
planId: string;
|
|
@@ -114,7 +114,7 @@ type CheckoutSession = {
|
|
|
114
114
|
type CancelSubscriptionResult = {
|
|
115
115
|
status: "canceled";
|
|
116
116
|
/**
|
|
117
|
-
* 해지된 구독의 결제 수단 (`sandbox` | `
|
|
117
|
+
* 해지된 구독의 결제 수단 (`sandbox` | `lemonsqueezy` | `toss` | `apple` | `google` | 옛 `paddle` …).
|
|
118
118
|
* 안내 문구를 결제 수단별로 가를 때 쓴다. 구버전 서버는 내려주지 않는다.
|
|
119
119
|
*/
|
|
120
120
|
provider?: string;
|
|
@@ -151,7 +151,7 @@ type CurrentPlan = {
|
|
|
151
151
|
/** ISO-8601 문자열. `null`이면 무기한. */
|
|
152
152
|
planExpiresAt: string | null;
|
|
153
153
|
/**
|
|
154
|
-
* **활성** 결제 연결의 제공자 — "
|
|
154
|
+
* **활성** 결제 연결의 제공자 — "lemonsqueezy" | "toss" | (옛) "paddle" | null.
|
|
155
155
|
*
|
|
156
156
|
* ⚠️ "실 결제인가"의 근거로 쓰지 말 것. 해지하면 연결이 보관되어 남은 이용 기간 동안
|
|
157
157
|
* `null`이 되고, 가상 결제·스토어 구독·운영자 배정도 모두 `null`이다. 그 판정에는
|
|
@@ -242,10 +242,34 @@ declare class ReoptPlansClient {
|
|
|
242
242
|
* always stopped; the provider-side cancellation is best-effort and reported
|
|
243
243
|
* through `providerCanceled`. Apple/Google subscriptions are canceled in the
|
|
244
244
|
* store, so no remote call is made for those.
|
|
245
|
+
*
|
|
246
|
+
* Lemon Squeezy charges renewals on its own, so for those the provider is
|
|
247
|
+
* canceled first: if that fails nothing changes (the subscription stays
|
|
248
|
+
* active) and the call fails with `PROVIDER_CANCEL_FAILED` (HTTP 502) — retry
|
|
249
|
+
* it. On success `accessUntil` is the provider's end of the paid period.
|
|
245
250
|
*/
|
|
246
251
|
cancel(accessToken: string): Promise<CancelSubscriptionResult>;
|
|
252
|
+
/**
|
|
253
|
+
* Switch the current customer's subscription to another plan — no new
|
|
254
|
+
* checkout: the provider subscription changes price in place, so it stays one
|
|
255
|
+
* subscription and keeps its renewal date. Lemon Squeezy subscriptions only
|
|
256
|
+
* (since 4.7); others fail with `PLAN_CHANGE_UNSUPPORTED` (cancel, then check
|
|
257
|
+
* out the new plan).
|
|
258
|
+
*
|
|
259
|
+
* Takes effect immediately and resolves to the changed plan (same shape as
|
|
260
|
+
* {@link getMyPlan}). Moving to a pricier plan charges the prorated
|
|
261
|
+
* difference now; moving to a cheaper one credits it on the next invoice.
|
|
262
|
+
*
|
|
263
|
+
* Errors (`ReoptSDKError.code`): `NO_ACTIVE_SUBSCRIPTION`, `SAME_PLAN`,
|
|
264
|
+
* `PLAN_NOT_FOUND` (404), `PLAN_INACTIVE`, `PLAN_PRICE_NOT_LINKED`,
|
|
265
|
+
* `TERMS_REQUIRED`, `SUBSCRIPTION_NOT_ACTIVE` (cancel scheduled or past due),
|
|
266
|
+
* `PROVIDER_PORTAL_REQUIRED` (PayPal subscriptions are changed in the
|
|
267
|
+
* provider's customer portal), `PROVIDER_ERROR` (HTTP 502 — nothing changed,
|
|
268
|
+
* retry).
|
|
269
|
+
*/
|
|
270
|
+
changePlan(planId: string, accessToken: string): Promise<CurrentPlan>;
|
|
247
271
|
}
|
|
248
272
|
declare function createReoptPlansClient(config: ReoptSDKConfig): ReoptPlansClient;
|
|
249
273
|
//#endregion
|
|
250
274
|
export { CheckoutStatus as a, MeterPricingMode as c, PlanInterval as d, PlanMeter as f, PlanRequiredTerms as h, CheckoutSession as i, Plan as l, PlanPaymentEnvironment as m, createReoptPlansClient as n, CreateCheckoutInput as o, PlanMeterTier as p, CancelSubscriptionResult as r, CurrentPlan as s, ReoptPlansClient as t, PlanBillingModel as u };
|
|
251
|
-
//# sourceMappingURL=client-
|
|
275
|
+
//# sourceMappingURL=client-C_X-hkb_.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as resolveIdBaseUrl } from "./config-
|
|
1
|
+
import { a as resolveIdBaseUrl } from "./config-CasmvpPc.js";
|
|
2
2
|
import { o as readClientKeyRing, s as toPublicJwk } from "./keys-B_R_lsyF.js";
|
|
3
3
|
import { createPrivateKeyJwtClientAssertionGetter } from "@better-auth/core/oauth2";
|
|
4
4
|
import * as jose from "jose";
|
|
@@ -191,4 +191,4 @@ function createMachineClient(config) {
|
|
|
191
191
|
|
|
192
192
|
//#endregion
|
|
193
193
|
export { createDpopProof as n, createMachineClient as r, MachineTokenError as t };
|
|
194
|
-
//# sourceMappingURL=client-
|
|
194
|
+
//# sourceMappingURL=client-DDouTFSX.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ReoptSDKError, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig } from "./config-
|
|
1
|
+
import { S as ReoptSDKError, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig } from "./config-CasmvpPc.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-D9GG3dtH.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-DbZHZJXf.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-D9GG3dtH.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-DkHxtSK1.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-D9GG3dtH.js";
|
|
2
2
|
|
|
3
3
|
//#region src/plans/client.ts
|
|
4
4
|
function unwrap(body) {
|
|
@@ -88,10 +88,36 @@ var ReoptPlansClient = class {
|
|
|
88
88
|
* always stopped; the provider-side cancellation is best-effort and reported
|
|
89
89
|
* through `providerCanceled`. Apple/Google subscriptions are canceled in the
|
|
90
90
|
* store, so no remote call is made for those.
|
|
91
|
+
*
|
|
92
|
+
* Lemon Squeezy charges renewals on its own, so for those the provider is
|
|
93
|
+
* canceled first: if that fails nothing changes (the subscription stays
|
|
94
|
+
* active) and the call fails with `PROVIDER_CANCEL_FAILED` (HTTP 502) — retry
|
|
95
|
+
* it. On success `accessUntil` is the provider's end of the paid period.
|
|
91
96
|
*/
|
|
92
97
|
async cancel(accessToken) {
|
|
93
98
|
return unwrap(await this.http.fetch("POST", "/me/subscription/cancel", {}, { bearerToken: accessToken }));
|
|
94
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Switch the current customer's subscription to another plan — no new
|
|
102
|
+
* checkout: the provider subscription changes price in place, so it stays one
|
|
103
|
+
* subscription and keeps its renewal date. Lemon Squeezy subscriptions only
|
|
104
|
+
* (since 4.7); others fail with `PLAN_CHANGE_UNSUPPORTED` (cancel, then check
|
|
105
|
+
* out the new plan).
|
|
106
|
+
*
|
|
107
|
+
* Takes effect immediately and resolves to the changed plan (same shape as
|
|
108
|
+
* {@link getMyPlan}). Moving to a pricier plan charges the prorated
|
|
109
|
+
* difference now; moving to a cheaper one credits it on the next invoice.
|
|
110
|
+
*
|
|
111
|
+
* Errors (`ReoptSDKError.code`): `NO_ACTIVE_SUBSCRIPTION`, `SAME_PLAN`,
|
|
112
|
+
* `PLAN_NOT_FOUND` (404), `PLAN_INACTIVE`, `PLAN_PRICE_NOT_LINKED`,
|
|
113
|
+
* `TERMS_REQUIRED`, `SUBSCRIPTION_NOT_ACTIVE` (cancel scheduled or past due),
|
|
114
|
+
* `PROVIDER_PORTAL_REQUIRED` (PayPal subscriptions are changed in the
|
|
115
|
+
* provider's customer portal), `PROVIDER_ERROR` (HTTP 502 — nothing changed,
|
|
116
|
+
* retry).
|
|
117
|
+
*/
|
|
118
|
+
async changePlan(planId, accessToken) {
|
|
119
|
+
return unwrap(await this.http.fetch("POST", "/me/subscription/change", { planId }, { bearerToken: accessToken }));
|
|
120
|
+
}
|
|
95
121
|
};
|
|
96
122
|
function createReoptPlansClient(config) {
|
|
97
123
|
return new ReoptPlansClient(config);
|
|
@@ -99,4 +125,4 @@ function createReoptPlansClient(config) {
|
|
|
99
125
|
|
|
100
126
|
//#endregion
|
|
101
127
|
export { createReoptPlansClient as n, ReoptPlansClient as t };
|
|
102
|
-
//# sourceMappingURL=client-
|
|
128
|
+
//# sourceMappingURL=client-DlKJi-nP.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-D9GG3dtH.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-DwwSQGMw.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-D9GG3dtH.js";
|
|
2
2
|
|
|
3
3
|
//#region src/analytics/client.ts
|
|
4
4
|
var ReoptAnalyticsClient = class {
|
|
@@ -17,4 +17,4 @@ function createReoptAnalyticsClient(config) {
|
|
|
17
17
|
|
|
18
18
|
//#endregion
|
|
19
19
|
export { createReoptAnalyticsClient as n, ReoptAnalyticsClient as t };
|
|
20
|
-
//# sourceMappingURL=client-
|
|
20
|
+
//# sourceMappingURL=client-Dx3RjILO.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as SDK_VERSION } from "./config-
|
|
1
|
+
import { n as SDK_VERSION } from "./config-CasmvpPc.js";
|
|
2
2
|
import { o as readClientKeyRing } from "./keys-B_R_lsyF.js";
|
|
3
|
-
import { r as createMachineClient } from "./client-
|
|
3
|
+
import { r as createMachineClient } from "./client-DDouTFSX.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/workspace/schemas.ts
|
|
@@ -733,4 +733,4 @@ function createPlatformClient(config) {
|
|
|
733
733
|
|
|
734
734
|
//#endregion
|
|
735
735
|
export { platformWorkTaskStageChangedEventSchema as $, platformErrorSchema as A, platformPipelineSchema as B, platformBrandappUpsertInputSchema as C, platformEavSchemaApplyInputSchema as D, platformEavEntityResourceSchema as E, platformOAuthClientImportInputSchema as F, platformResourcesV2Schema as G, platformPipelineUpsertInputSchema as H, platformOAuthClientResourceSchema as I, platformTaskStageSchema as J, platformTaskSchema as K, platformOAuthClientUpsertInputSchema as L, platformLockAcquiredSchema as M, platformLockReleasedSchema as N, platformEavSchemaApplyResultSchema as O, platformMeSchema as P, platformWebhookUpsertInputSchema as Q, platformPipelineImportInputSchema as R, platformBrandappResourceSchema as S, platformEavBrandappResourcesSchema as T, platformResourceKeySchema as U, platformPipelineStageInputSchema as V, platformResourcesSchema as W, platformWebhookResourceSchema as X, platformTaskUpsertInputSchema as Y, platformWebhookSchema as Z, PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS as _, createPlatformClient as a, platformBrandResourceSchema as b, PLATFORM_BRANDAPP_STATUSES as c, PLATFORM_OAUTH_APPLICATION_TYPES as d, platformWriteMetaSchema as et, PLATFORM_OAUTH_CLIENT_PURPOSES as f, PLATFORM_TASK_PRIORITIES as g, PLATFORM_TASK_OUTCOMES as h, REOPT_PLATFORM_URLS as i, platformExternalIdSchema as j, platformEavSchemaOperationSchema as k, PLATFORM_DOMAIN_STATUSES as l, PLATFORM_STAGE_COLORS as m, PlatformApiError as n, resolvePlatformUrls as o, PLATFORM_OAUTH_GRANT_TYPES as p, platformTaskStageInputSchema as q, REOPT_PLATFORM_ID_URLS as r, PLATFORM_ADMIN_SCOPE as s, DEFAULT_PLATFORM_SCOPES as t, PLATFORM_MANAGED_BY_VALUES as u, PLATFORM_WEBHOOK_TRIGGERS as v, platformCustomerUpsertInputSchema as w, platformBrandUpsertInputSchema as x, platformBrandImportInputSchema as y, platformPipelineResourceSchema as z };
|
|
736
|
-
//# sourceMappingURL=client-
|
|
736
|
+
//# sourceMappingURL=client-_fMnz8Ot.js.map
|
package/dist/cms/index.js
CHANGED
|
@@ -35,8 +35,8 @@ var RateLimitError = class extends ReoptSDKError {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
var ServerError = class extends ReoptSDKError {
|
|
38
|
-
constructor(message = "Internal server error", context) {
|
|
39
|
-
super(message, 500, "SERVER_ERROR", context, {
|
|
38
|
+
constructor(message = "Internal server error", context, reported) {
|
|
39
|
+
super(message, reported?.status ?? 500, reported?.code ?? "SERVER_ERROR", context, {
|
|
40
40
|
cause: "서버 내부 오류",
|
|
41
41
|
fix: "잠시 후 재시도. 반복되면 서버 상태 확인",
|
|
42
42
|
doc: "docs/errors.md#server_error"
|
|
@@ -312,14 +312,17 @@ function mapHttpStatusToError(status, code, message, ctx, fieldErrors) {
|
|
|
312
312
|
return new ReoptSDKError(message ?? `Request failed with status ${status}`, 422, code ?? "REQUEST_ERROR", ctx);
|
|
313
313
|
case 429: return new RateLimitError(message ?? "Rate limit exceeded", void 0, ctx);
|
|
314
314
|
default:
|
|
315
|
-
if (status >= 500) return new ServerError(message ?? "Internal server error", ctx
|
|
315
|
+
if (status >= 500) return new ServerError(message ?? "Internal server error", ctx, {
|
|
316
|
+
status,
|
|
317
|
+
code
|
|
318
|
+
});
|
|
316
319
|
return new ReoptSDKError(message ?? `Unexpected status: ${status}`, status, code ?? "UNEXPECTED_ERROR", ctx);
|
|
317
320
|
}
|
|
318
321
|
}
|
|
319
322
|
|
|
320
323
|
//#endregion
|
|
321
324
|
//#region src/core/config.ts
|
|
322
|
-
const SDK_VERSION = "4.7.0-rc.
|
|
325
|
+
const SDK_VERSION = "4.7.0-rc.5";
|
|
323
326
|
/**
|
|
324
327
|
* Default API host for EAV / AI / Files / CMS / Terms. Consumers can override
|
|
325
328
|
* via `config.baseUrl` or the `REOPT_BASE_URL` env var.
|
|
@@ -501,4 +504,4 @@ function deriveIdFromBaseUrl(baseUrl) {
|
|
|
501
504
|
|
|
502
505
|
//#endregion
|
|
503
506
|
export { isValidationError as A, RequiredTermsError as C, isModelAccessError as D, isCreditLimitError as E, isReoptSDKError as O, ReoptSDKError as S, ValidationError as T, ModelAccessError as _, resolveIdBaseUrl as a, PreconditionFailedError as b, AuthUserNotFoundError as c, ConflictError as d, ContentFilterError as f, LimitExceededError as g, ForbiddenError as h, resolveBaseUrl as i, mapHttpStatusToError as j, isRequiredTermsError 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, ServerError as w, RateLimitError as x, NotFoundError as y };
|
|
504
|
-
//# sourceMappingURL=config-
|
|
507
|
+
//# sourceMappingURL=config-CasmvpPc.js.map
|
package/dist/eav/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as ListRecordsQuery, C as EavAttribute, D as EavRecord, E as EavEntity, F as UpdateRecordInput, I as UpsertRecordInput, L as UpsertRecordResult, M as RECORDS_PAGE_LIMIT_MAX, N as UpdateAttributeInput, O as EavSchemaLinkedTo, P as UpdateEntityInput, S as DeleteWhereInput, T as EavDataType, _ as BulkUpdateItem, b as CreateEntityInput, d as ATTRIBUTE_FILTER_OPERATORS, f as AttributeFilter, j as PaginatedResponse, k as EavValidation, m as AttributeFilterOperator, n as ReoptSDKConfig, p as AttributeFilterListValue, u as ATTRIBUTE_FILTER_LIST_MAX, v as CountRecordsQuery, w as EavAttributeOption, x as CreateRecordInput, y as CreateAttributeInput } from "../config-BGT9h1OW.js";
|
|
2
|
-
import { c as DuplicateAuthUserError, f as LimitExceededError, n as AuthUserNotFoundError, r as AuthUserRecordExistsError } from "../errors-
|
|
2
|
+
import { c as DuplicateAuthUserError, f as LimitExceededError, n as AuthUserNotFoundError, r as AuthUserRecordExistsError } from "../errors-D-Va8oeC.js";
|
|
3
3
|
import { i as TypedEavRecord, n as createReoptEavClient, r as EntityClient, t as ReoptEavClient } from "../client-CJRjPSf7.js";
|
|
4
4
|
//#region src/eav/verify.d.ts
|
|
5
5
|
/**
|
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 { i as RECORDS_PAGE_LIMIT_MAX, n as ATTRIBUTE_FILTER_LIST_MAX, r as ATTRIBUTE_FILTER_OPERATORS, t as createReoptEavClient } from "../client-
|
|
1
|
+
import { c as AuthUserNotFoundError, g as LimitExceededError, l as AuthUserRecordExistsError, m as DuplicateAuthUserError } from "../config-CasmvpPc.js";
|
|
2
|
+
import { i as RECORDS_PAGE_LIMIT_MAX, n as ATTRIBUTE_FILTER_LIST_MAX, r as ATTRIBUTE_FILTER_OPERATORS, t as createReoptEavClient } from "../client-BEcJrDub.js";
|
|
3
3
|
|
|
4
4
|
//#region src/eav/verify.ts
|
|
5
5
|
async function verifyEavSchema(input) {
|
|
@@ -35,7 +35,10 @@ declare class RateLimitError extends ReoptSDKError {
|
|
|
35
35
|
constructor(message?: string, retryAfterMs?: number, context?: ReoptSDKErrorContext);
|
|
36
36
|
}
|
|
37
37
|
declare class ServerError extends ReoptSDKError {
|
|
38
|
-
constructor(message?: string, context?: ReoptSDKErrorContext
|
|
38
|
+
constructor(message?: string, context?: ReoptSDKErrorContext, reported?: {
|
|
39
|
+
status?: number;
|
|
40
|
+
code?: string;
|
|
41
|
+
});
|
|
39
42
|
}
|
|
40
43
|
/** AI 사용량 잔액 부족 (HTTP 402). */
|
|
41
44
|
declare class CreditLimitError extends ReoptSDKError {
|
|
@@ -186,4 +189,4 @@ declare function isModelAccessError(error: unknown): error is ModelAccessError;
|
|
|
186
189
|
declare function mapHttpStatusToError(status: number, code: string | undefined, message: string | undefined, ctx?: ReoptSDKErrorContext, fieldErrors?: FieldError[]): ReoptSDKError;
|
|
187
190
|
//#endregion
|
|
188
191
|
export { isCreditLimitError as C, isValidationError as D, isRequiredTermsError as E, mapHttpStatusToError as O, ValidationError as S, isReoptSDKError as T, RateLimitError as _, ConflictError as a, RequiredTermsError as b, DuplicateAuthUserError as c, ForbiddenError as d, LimitExceededError as f, PreconditionFailedError 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, ReoptSDKError as v, isModelAccessError as w, ServerError as x, ReoptSDKErrorContext as y };
|
|
189
|
-
//# sourceMappingURL=errors-
|
|
192
|
+
//# sourceMappingURL=errors-D-Va8oeC.d.ts.map
|
package/dist/feedback/index.js
CHANGED
package/dist/files/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as ReoptSDKError, a as resolveIdBaseUrl, i as resolveBaseUrl, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, w as ServerError, x as RateLimitError } from "./config-
|
|
1
|
+
import { S as ReoptSDKError, a as resolveIdBaseUrl, i as resolveBaseUrl, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, w as ServerError, x as RateLimitError } from "./config-CasmvpPc.js";
|
|
2
2
|
import { t as createAuthHeader } from "./encoding-Bwfm3iaE.js";
|
|
3
3
|
|
|
4
4
|
//#region src/core/debug.ts
|
|
@@ -389,4 +389,4 @@ function parseFieldErrors(body) {
|
|
|
389
389
|
|
|
390
390
|
//#endregion
|
|
391
391
|
export { parseFieldErrors as n, BaseHttpClient as t };
|
|
392
|
-
//# sourceMappingURL=http-client-
|
|
392
|
+
//# sourceMappingURL=http-client-D9GG3dtH.js.map
|
|
@@ -6,7 +6,7 @@ import { t as ReoptCmsClient } from "./client-NUhpPkl2.js";
|
|
|
6
6
|
import { t as ReoptEavClient } from "./client-CJRjPSf7.js";
|
|
7
7
|
import { t as ReoptFeedbackClient } from "./client-DF-tOyrY.js";
|
|
8
8
|
import { t as ReoptFileClient } from "./client-wNzcgEJu.js";
|
|
9
|
-
import { t as ReoptPlansClient } from "./client-
|
|
9
|
+
import { t as ReoptPlansClient } from "./client-C_X-hkb_.js";
|
|
10
10
|
import { t as ReoptPushClient } from "./client-BbmslwWV.js";
|
|
11
11
|
import { t as ReoptTermsClient } from "./client-Dwf6UuGH.js";
|
|
12
12
|
//#region src/core/http-client.d.ts
|
|
@@ -178,4 +178,4 @@ type ReoptSDK<S extends SchemaDef = SchemaDef> = {
|
|
|
178
178
|
declare function createReoptSDK<S extends SchemaDef = SchemaDef>(config: ReoptSDKConfig<S>): ReoptSDK<S>;
|
|
179
179
|
//#endregion
|
|
180
180
|
export { initReoptSDK as a, getReoptSDK as i, createReoptSDK as n, resetSDK as o, createLazySDK as r, BaseHttpClient as s, ReoptSDK as t };
|
|
181
|
-
//# sourceMappingURL=index-
|
|
181
|
+
//# sourceMappingURL=index-B2Jh3WzX.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as DebugLogger, i as DebugLevel, n as ReoptSDKConfig, r as resolveBaseUrl, t as REOPT_BASE_URLS } from "./config-BGT9h1OW.js";
|
|
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-Bi-KSU_r.js";
|
|
3
|
-
import { C as isCreditLimitError, D as isValidationError, E as isRequiredTermsError, O as mapHttpStatusToError, S as ValidationError, T as isReoptSDKError, _ as RateLimitError, a as ConflictError, b as RequiredTermsError, c as DuplicateAuthUserError, d as ForbiddenError, f as LimitExceededError, g as PreconditionFailedError, 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 ReoptSDKError, w as isModelAccessError, x as ServerError, y as ReoptSDKErrorContext } from "./errors-
|
|
3
|
+
import { C as isCreditLimitError, D as isValidationError, E as isRequiredTermsError, O as mapHttpStatusToError, S as ValidationError, T as isReoptSDKError, _ as RateLimitError, a as ConflictError, b as RequiredTermsError, c as DuplicateAuthUserError, d as ForbiddenError, f as LimitExceededError, g as PreconditionFailedError, 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 ReoptSDKError, w as isModelAccessError, x as ServerError, y as ReoptSDKErrorContext } from "./errors-D-Va8oeC.js";
|
|
4
4
|
import { i as TypedEavRecord, r as EntityClient } from "./client-CJRjPSf7.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-B2Jh3WzX.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, PreconditionFailedError, 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,15 +1,15 @@
|
|
|
1
|
-
import { A as isValidationError, C as RequiredTermsError, D as isModelAccessError, E as isCreditLimitError, O as isReoptSDKError, S as ReoptSDKError, T as ValidationError, _ as ModelAccessError, b as PreconditionFailedError, c as AuthUserNotFoundError, d as ConflictError, f as ContentFilterError, g as LimitExceededError, h as ForbiddenError, i as resolveBaseUrl, j as mapHttpStatusToError, k as isRequiredTermsError, 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 ServerError, x as RateLimitError, 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 createReoptAnalyticsClient } from "./client-
|
|
10
|
-
import { n as createReoptPlansClient } from "./client-
|
|
11
|
-
import { n as createReoptPushClient } from "./client-
|
|
12
|
-
import { n as createReoptTermsClient } from "./client-
|
|
1
|
+
import { A as isValidationError, C as RequiredTermsError, D as isModelAccessError, E as isCreditLimitError, O as isReoptSDKError, S as ReoptSDKError, T as ValidationError, _ as ModelAccessError, b as PreconditionFailedError, c as AuthUserNotFoundError, d as ConflictError, f as ContentFilterError, g as LimitExceededError, h as ForbiddenError, i as resolveBaseUrl, j as mapHttpStatusToError, k as isRequiredTermsError, 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 ServerError, x as RateLimitError, y as NotFoundError } from "./config-CasmvpPc.js";
|
|
2
|
+
import { t as BaseHttpClient } from "./http-client-D9GG3dtH.js";
|
|
3
|
+
import { n as createReoptAiClient } from "./client-B1oQZrBf.js";
|
|
4
|
+
import { n as createReoptAuthClient } from "./client-C0WZeTm5.js";
|
|
5
|
+
import { t as createReoptCmsClient } from "./client-CW4dDKUa.js";
|
|
6
|
+
import { t as createReoptEavClient } from "./client-BEcJrDub.js";
|
|
7
|
+
import { n as createReoptFeedbackClient } from "./client-BR4DzwcK.js";
|
|
8
|
+
import { n as createReoptFileClient } from "./client-DbZHZJXf.js";
|
|
9
|
+
import { n as createReoptAnalyticsClient } from "./client-Dx3RjILO.js";
|
|
10
|
+
import { n as createReoptPlansClient } from "./client-DlKJi-nP.js";
|
|
11
|
+
import { n as createReoptPushClient } from "./client-DwwSQGMw.js";
|
|
12
|
+
import { n as createReoptTermsClient } from "./client-DkHxtSK1.js";
|
|
13
13
|
|
|
14
14
|
//#region src/singleton.ts
|
|
15
15
|
let _instance;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as SDK_VERSION } from "../config-
|
|
1
|
+
import { n as SDK_VERSION } from "../config-CasmvpPc.js";
|
|
2
2
|
import { o as readClientKeyRing } from "../keys-B_R_lsyF.js";
|
|
3
|
-
import { r as createMachineClient } from "../client-
|
|
4
|
-
import { A as platformErrorSchema, C as platformBrandappUpsertInputSchema, H as platformPipelineUpsertInputSchema, U as platformResourceKeySchema, f as PLATFORM_OAUTH_CLIENT_PURPOSES, n as PlatformApiError, o as resolvePlatformUrls, v as PLATFORM_WEBHOOK_TRIGGERS, x as platformBrandUpsertInputSchema } from "../client-
|
|
3
|
+
import { r as createMachineClient } from "../client-DDouTFSX.js";
|
|
4
|
+
import { A as platformErrorSchema, C as platformBrandappUpsertInputSchema, H as platformPipelineUpsertInputSchema, U as platformResourceKeySchema, f as PLATFORM_OAUTH_CLIENT_PURPOSES, n as PlatformApiError, o as resolvePlatformUrls, v as PLATFORM_WEBHOOK_TRIGGERS, x as platformBrandUpsertInputSchema } from "../client-_fMnz8Ot.js";
|
|
5
5
|
import * as jose from "jose";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
|
package/dist/logout/index.js
CHANGED
package/dist/machine/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { a as parseClientPrivateJwk, i as generateClientKeyPair, n as DEFAULT_CLIENT_KEY_ALGORITHM, o as readClientKeyRing, r as buildClientJwks, s as toPublicJwk, t as CLIENT_JWKS_PATH } from "../keys-B_R_lsyF.js";
|
|
2
|
-
import { n as createDpopProof, r as createMachineClient, t as MachineTokenError } from "../client-
|
|
2
|
+
import { n as createDpopProof, r as createMachineClient, t as MachineTokenError } from "../client-DDouTFSX.js";
|
|
3
3
|
|
|
4
4
|
export { CLIENT_JWKS_PATH, DEFAULT_CLIENT_KEY_ALGORITHM, MachineTokenError, buildClientJwks, createDpopProof, createMachineClient, generateClientKeyPair, parseClientPrivateJwk, readClientKeyRing, toPublicJwk };
|
package/dist/plans/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as CheckoutStatus, c as MeterPricingMode, d as PlanInterval, f as PlanMeter, h as PlanRequiredTerms, i as CheckoutSession, l as Plan, m as PlanPaymentEnvironment, n as createReoptPlansClient, o as CreateCheckoutInput, p as PlanMeterTier, r as CancelSubscriptionResult, s as CurrentPlan, t as ReoptPlansClient, u as PlanBillingModel } from "../client-
|
|
1
|
+
import { a as CheckoutStatus, c as MeterPricingMode, d as PlanInterval, f as PlanMeter, h as PlanRequiredTerms, i as CheckoutSession, l as Plan, m as PlanPaymentEnvironment, n as createReoptPlansClient, o as CreateCheckoutInput, p as PlanMeterTier, r as CancelSubscriptionResult, s as CurrentPlan, t as ReoptPlansClient, u as PlanBillingModel } from "../client-C_X-hkb_.js";
|
|
2
2
|
export { type CancelSubscriptionResult, type CheckoutSession, type CheckoutStatus, type CreateCheckoutInput, type CurrentPlan, type MeterPricingMode, type Plan, type PlanBillingModel, type PlanInterval, type PlanMeter, type PlanMeterTier, type PlanPaymentEnvironment, type PlanRequiredTerms, ReoptPlansClient, createReoptPlansClient };
|
package/dist/plans/index.js
CHANGED
package/dist/push/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as ReoptSDKError } from "./config-
|
|
1
|
+
import { S as ReoptSDKError } from "./config-CasmvpPc.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-DVNclHZU.js.map
|
package/dist/react/hooks.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { A as ListRecordsQuery, C as EavAttribute, D as EavRecord, E as EavEntity, F as UpdateRecordInput, I as UpsertRecordInput, L as UpsertRecordResult, S as DeleteWhereInput, _ as BulkUpdateItem, j as PaginatedResponse, x as CreateRecordInput } from "../config-BGT9h1OW.js";
|
|
2
2
|
import { a as CompletionOptions, f as ModelInfo, l as ImageGenerateOptions, o as CompletionResult, p as StreamDoneData, r as AgentInfo, s as CreditInfo, u as ImageGenerateResult } from "../client-Bi-KSU_r.js";
|
|
3
|
-
import { v as ReoptSDKError } from "../errors-
|
|
3
|
+
import { v as ReoptSDKError } from "../errors-D-Va8oeC.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-wNzcgEJu.js";
|
|
6
|
-
import { t as ReoptSDK } from "../index-
|
|
6
|
+
import { t as ReoptSDK } from "../index-B2Jh3WzX.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-Dh8XMVFF.js";
|
|
2
|
-
import { t as ReoptSDK } from "../index-
|
|
2
|
+
import { t as ReoptSDK } from "../index-B2Jh3WzX.js";
|
|
3
3
|
//#region src/testing/index.d.ts
|
|
4
4
|
type TestSDKOptions = {
|
|
5
5
|
/** EAV schema to seed entities and attributes */
|
package/dist/workspace/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as platformWorkTaskStageChangedEventSchema, A as platformErrorSchema, B as platformPipelineSchema, C as platformBrandappUpsertInputSchema, D as platformEavSchemaApplyInputSchema, E as platformEavEntityResourceSchema, F as platformOAuthClientImportInputSchema, G as platformResourcesV2Schema, H as platformPipelineUpsertInputSchema, I as platformOAuthClientResourceSchema, J as platformTaskStageSchema, K as platformTaskSchema, L as platformOAuthClientUpsertInputSchema, M as platformLockAcquiredSchema, N as platformLockReleasedSchema, O as platformEavSchemaApplyResultSchema, P as platformMeSchema, Q as platformWebhookUpsertInputSchema, R as platformPipelineImportInputSchema, S as platformBrandappResourceSchema, T as platformEavBrandappResourcesSchema, U as platformResourceKeySchema, V as platformPipelineStageInputSchema, W as platformResourcesSchema, X as platformWebhookResourceSchema, Y as platformTaskUpsertInputSchema, Z as platformWebhookSchema, _ as PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS, a as createPlatformClient, b as platformBrandResourceSchema, c as PLATFORM_BRANDAPP_STATUSES, d as PLATFORM_OAUTH_APPLICATION_TYPES, et as platformWriteMetaSchema, f as PLATFORM_OAUTH_CLIENT_PURPOSES, g as PLATFORM_TASK_PRIORITIES, h as PLATFORM_TASK_OUTCOMES, i as REOPT_PLATFORM_URLS, j as platformExternalIdSchema, k as platformEavSchemaOperationSchema, l as PLATFORM_DOMAIN_STATUSES, m as PLATFORM_STAGE_COLORS, n as PlatformApiError, o as resolvePlatformUrls, p as PLATFORM_OAUTH_GRANT_TYPES, q as platformTaskStageInputSchema, r as REOPT_PLATFORM_ID_URLS, s as PLATFORM_ADMIN_SCOPE, t as DEFAULT_PLATFORM_SCOPES, u as PLATFORM_MANAGED_BY_VALUES, v as PLATFORM_WEBHOOK_TRIGGERS, w as platformCustomerUpsertInputSchema, x as platformBrandUpsertInputSchema, y as platformBrandImportInputSchema, z as platformPipelineResourceSchema } from "../client-
|
|
1
|
+
import { $ as platformWorkTaskStageChangedEventSchema, A as platformErrorSchema, B as platformPipelineSchema, C as platformBrandappUpsertInputSchema, D as platformEavSchemaApplyInputSchema, E as platformEavEntityResourceSchema, F as platformOAuthClientImportInputSchema, G as platformResourcesV2Schema, H as platformPipelineUpsertInputSchema, I as platformOAuthClientResourceSchema, J as platformTaskStageSchema, K as platformTaskSchema, L as platformOAuthClientUpsertInputSchema, M as platformLockAcquiredSchema, N as platformLockReleasedSchema, O as platformEavSchemaApplyResultSchema, P as platformMeSchema, Q as platformWebhookUpsertInputSchema, R as platformPipelineImportInputSchema, S as platformBrandappResourceSchema, T as platformEavBrandappResourcesSchema, U as platformResourceKeySchema, V as platformPipelineStageInputSchema, W as platformResourcesSchema, X as platformWebhookResourceSchema, Y as platformTaskUpsertInputSchema, Z as platformWebhookSchema, _ as PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS, a as createPlatformClient, b as platformBrandResourceSchema, c as PLATFORM_BRANDAPP_STATUSES, d as PLATFORM_OAUTH_APPLICATION_TYPES, et as platformWriteMetaSchema, f as PLATFORM_OAUTH_CLIENT_PURPOSES, g as PLATFORM_TASK_PRIORITIES, h as PLATFORM_TASK_OUTCOMES, i as REOPT_PLATFORM_URLS, j as platformExternalIdSchema, k as platformEavSchemaOperationSchema, l as PLATFORM_DOMAIN_STATUSES, m as PLATFORM_STAGE_COLORS, n as PlatformApiError, o as resolvePlatformUrls, p as PLATFORM_OAUTH_GRANT_TYPES, q as platformTaskStageInputSchema, r as REOPT_PLATFORM_ID_URLS, s as PLATFORM_ADMIN_SCOPE, t as DEFAULT_PLATFORM_SCOPES, u as PLATFORM_MANAGED_BY_VALUES, v as PLATFORM_WEBHOOK_TRIGGERS, w as platformCustomerUpsertInputSchema, x as platformBrandUpsertInputSchema, y as platformBrandImportInputSchema, z as platformPipelineResourceSchema } from "../client-_fMnz8Ot.js";
|
|
2
2
|
|
|
3
3
|
export { DEFAULT_PLATFORM_SCOPES, PLATFORM_ADMIN_SCOPE, PLATFORM_BRANDAPP_STATUSES, PLATFORM_DOMAIN_STATUSES, PLATFORM_MANAGED_BY_VALUES, PLATFORM_OAUTH_APPLICATION_TYPES, PLATFORM_OAUTH_CLIENT_PURPOSES, PLATFORM_OAUTH_GRANT_TYPES, PLATFORM_STAGE_COLORS, PLATFORM_TASK_OUTCOMES, PLATFORM_TASK_PRIORITIES, PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS, PLATFORM_WEBHOOK_TRIGGERS, PlatformApiError, REOPT_PLATFORM_ID_URLS, REOPT_PLATFORM_URLS, createPlatformClient, platformBrandImportInputSchema, platformBrandResourceSchema, platformBrandUpsertInputSchema, platformBrandappResourceSchema, platformBrandappUpsertInputSchema, platformCustomerUpsertInputSchema, platformEavBrandappResourcesSchema, platformEavEntityResourceSchema, platformEavSchemaApplyInputSchema, platformEavSchemaApplyResultSchema, platformEavSchemaOperationSchema, platformErrorSchema, platformExternalIdSchema, platformLockAcquiredSchema, platformLockReleasedSchema, platformMeSchema, platformOAuthClientImportInputSchema, platformOAuthClientResourceSchema, platformOAuthClientUpsertInputSchema, platformPipelineImportInputSchema, platformPipelineResourceSchema, platformPipelineSchema, platformPipelineStageInputSchema, platformPipelineUpsertInputSchema, platformResourceKeySchema, platformResourcesSchema, platformResourcesV2Schema, platformTaskSchema, platformTaskStageInputSchema, platformTaskStageSchema, platformTaskUpsertInputSchema, platformWebhookResourceSchema, platformWebhookSchema, platformWebhookUpsertInputSchema, platformWorkTaskStageChangedEventSchema, platformWriteMetaSchema, resolvePlatformUrls };
|
package/docs/api-reference.md
CHANGED
|
@@ -639,6 +639,17 @@ canceled.providerCanceled; // false → local subscription is definitely over (n
|
|
|
639
639
|
// remnant that an operator should check (3.4+)
|
|
640
640
|
```
|
|
641
641
|
|
|
642
|
+
```ts
|
|
643
|
+
// Switch plans while subscribed (Lemon Squeezy, 4.7+) — no new checkout.
|
|
644
|
+
// Immediate; resolves to the changed plan (same shape as getMyPlan).
|
|
645
|
+
// Upgrades charge the prorated difference now, downgrades credit the next invoice.
|
|
646
|
+
const plan: CurrentPlan = await sdk.plans.changePlan(teamPlanId, accessToken);
|
|
647
|
+
plan.planId; // teamPlanId
|
|
648
|
+
// e.code: NO_ACTIVE_SUBSCRIPTION | SAME_PLAN | PLAN_NOT_FOUND | PLAN_INACTIVE |
|
|
649
|
+
// PLAN_PRICE_NOT_LINKED | TERMS_REQUIRED | SUBSCRIPTION_NOT_ACTIVE |
|
|
650
|
+
// PROVIDER_PORTAL_REQUIRED (PayPal → provider portal) | PROVIDER_ERROR (502, retry)
|
|
651
|
+
```
|
|
652
|
+
|
|
642
653
|
> The three fields added in 3.4 are optional — an older platform deployment
|
|
643
654
|
> simply omits them. Apple/Google (IAP) subscriptions are canceled in the store,
|
|
644
655
|
> so no remote call is made and `providerCanceled` stays `false`.
|
package/docs/errors.md
CHANGED
|
@@ -266,6 +266,27 @@ try {
|
|
|
266
266
|
}
|
|
267
267
|
```
|
|
268
268
|
|
|
269
|
+
### Plan change & cancel (`sdk.plans.changePlan` / `sdk.plans.cancel`, 4.7+)
|
|
270
|
+
|
|
271
|
+
Refusals come back as `ConflictError` (409) with these `code`s — nothing was
|
|
272
|
+
changed and no provider call was made:
|
|
273
|
+
|
|
274
|
+
| code | meaning | what to do |
|
|
275
|
+
| --------------------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------- |
|
|
276
|
+
| `NO_ACTIVE_SUBSCRIPTION` | no subscription to change | check out the plan instead |
|
|
277
|
+
| `SAME_PLAN` | already on that plan | re-read `getMyPlan` — after a retry this means the first call landed |
|
|
278
|
+
| `PLAN_INACTIVE` / `PLAN_SCOPE_MISMATCH` | the target plan is not sellable here | refresh the plan list |
|
|
279
|
+
| `PLAN_CHANGE_UNSUPPORTED` | not a Lemon Squeezy subscription, or a different currency / non-recurring plan | cancel, then check out |
|
|
280
|
+
| `PLAN_PRICE_NOT_LINKED` | the plan has no provider price yet | ask the app operator |
|
|
281
|
+
| `TERMS_REQUIRED` | the new plan needs terms consent | collect consent via `sdk.terms`, retry |
|
|
282
|
+
| `SUBSCRIPTION_NOT_ACTIVE` | cancel scheduled or payment past due | resume / fix payment first |
|
|
283
|
+
| `PROVIDER_PORTAL_REQUIRED` | PayPal subscription — the provider API cannot change it | send the customer to the provider's customer portal (receipt e-mail link) |
|
|
284
|
+
|
|
285
|
+
`PLAN_NOT_FOUND` is a `NotFoundError` (404). A provider-side failure is a
|
|
286
|
+
`ServerError` with `status: 502` and `code: "PROVIDER_ERROR"` (changePlan) or
|
|
287
|
+
`"PROVIDER_CANCEL_FAILED"` (cancel) — nothing changed, retry. POST calls are
|
|
288
|
+
not retried automatically.
|
|
289
|
+
|
|
269
290
|
### FORBIDDEN: `Forbidden` / `Model tier not available` (403)
|
|
270
291
|
|
|
271
292
|
- **Cause**: No permission for the resource — e.g. the requested model
|