@reopt-ai/brandapp-sdk 4.7.0-rc.5 → 4.7.0-rc.6
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 +15 -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.js +2 -2
- package/dist/{client-CW4dDKUa.js → client-4x4xlk9N.js} +3 -3
- package/dist/{client-B1oQZrBf.js → client-BrR3dzC_.js} +4 -4
- package/dist/{client-DkHxtSK1.js → client-C1yI9DiK.js} +2 -2
- package/dist/{client-DwwSQGMw.js → client-C7k9bCwh.js} +2 -2
- package/dist/{client-DlKJi-nP.js → client-CLsqp1Jn.js} +20 -2
- package/dist/{client-Dx3RjILO.js → client-COlwskCB.js} +2 -2
- package/dist/{client-BEcJrDub.js → client-DEMD0Wo5.js} +4 -4
- package/dist/{client-_fMnz8Ot.js → client-DMvufVds.js} +3 -3
- package/dist/{client-BR4DzwcK.js → client-DVIuxsN7.js} +2 -2
- package/dist/{client-C0WZeTm5.js → client-DZZEzs2l.js} +2 -2
- package/dist/{client-C_X-hkb_.d.ts → client-Dsz0BzpO.d.ts} +17 -1
- package/dist/{client-DbZHZJXf.js → client-UI1-_F9P.js} +3 -3
- package/dist/{client-DDouTFSX.js → client-t7ASsw2Q.js} +2 -2
- package/dist/cms/index.js +1 -1
- package/dist/{config-CasmvpPc.js → config-Cb96ydFD.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-D9GG3dtH.js → http-client-DIewtTz2.js} +2 -2
- package/dist/{index-B2Jh3WzX.d.ts → index-VolJHcFS.d.ts} +2 -2
- package/dist/index.d.ts +1 -1
- 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-DVNclHZU.js → query-jbkDQ1o2.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/dist/workspace/index.js +1 -1
- package/docs/api-reference.md +10 -2
- package/docs/errors.md +13 -11
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,21 @@ This project adheres to [Semantic Versioning](https://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [4.7.0-rc.6] — 2026-10-15
|
|
11
|
+
|
|
12
|
+
Pre-release (`npm i @reopt-ai/brandapp-sdk@next`) — 해지 예약 구독 재개(`plans.resume`)와 해지 기간 중 새 결제 차단.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- `plans.resume(accessToken)` — 결제한 기간이 남은 해지 예약 구독을 되살린다(`POST /me/subscription/resume`, Lemon
|
|
17
|
+
Squeezy). 같은 구독이 갱신일 그대로 이어지고 바뀐 플랜(`getMyPlan`과 같은 모양)을 돌려준다. 거절은
|
|
18
|
+
`NO_RESUMABLE_SUBSCRIPTION`(409), 결제사 실패는 `PROVIDER_ERROR`(502, 재시도).
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- `plans.createCheckout` — 해지 예약 구독이 결제한 기간을 남기고 있으면 `SUBSCRIPTION_CANCEL_PENDING`(409)으로
|
|
23
|
+
거절한다. 새 구독을 열면 옛 구독과 겹친 기간을 두 번 내기 때문이다 — `resume` 뒤 다른 플랜이면 `changePlan`.
|
|
24
|
+
|
|
10
25
|
## [4.7.0-rc.5] — 2026-10-14
|
|
11
26
|
|
|
12
27
|
Pre-release (`npm i @reopt-ai/brandapp-sdk@next`) — 구독 중 플랜 변경(`plans.changePlan`)과 Lemon Squeezy 해지 계약, 5xx 오류 코드 보존.
|
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-Cb96ydFD.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-COlwskCB.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,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-Cb96ydFD.js";
|
|
2
|
+
import { t as BaseHttpClient } from "../http-client-DIewtTz2.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,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-DIewtTz2.js";
|
|
2
|
+
import { t as buildQuery } from "./query-jbkDQ1o2.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-4x4xlk9N.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-Cb96ydFD.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-DIewtTz2.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.6"}-${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-BrR3dzC_.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-DIewtTz2.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-C1yI9DiK.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-DIewtTz2.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-C7k9bCwh.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-DIewtTz2.js";
|
|
2
2
|
|
|
3
3
|
//#region src/plans/client.ts
|
|
4
4
|
function unwrap(body) {
|
|
@@ -118,6 +118,24 @@ var ReoptPlansClient = class {
|
|
|
118
118
|
async changePlan(planId, accessToken) {
|
|
119
119
|
return unwrap(await this.http.fetch("POST", "/me/subscription/change", { planId }, { bearerToken: accessToken }));
|
|
120
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Resume the current customer's canceled subscription while its paid period
|
|
123
|
+
* is still running (Lemon Squeezy, since 4.7) — the same provider
|
|
124
|
+
* subscription continues with its renewal date. Resolves to the resumed plan
|
|
125
|
+
* (same shape as {@link getMyPlan}).
|
|
126
|
+
*
|
|
127
|
+
* During that period {@link createCheckout} refuses with
|
|
128
|
+
* `SUBSCRIPTION_CANCEL_PENDING` (409): a new checkout would start a second
|
|
129
|
+
* subscription and bill the overlap twice. Resume instead, then
|
|
130
|
+
* {@link changePlan} if the customer wants another plan.
|
|
131
|
+
*
|
|
132
|
+
* Errors (`ReoptSDKError.code`): `NO_RESUMABLE_SUBSCRIPTION` (409 — nothing
|
|
133
|
+
* canceled, or the paid period is over), `PROVIDER_ERROR` (HTTP 502 —
|
|
134
|
+
* nothing changed, retry).
|
|
135
|
+
*/
|
|
136
|
+
async resume(accessToken) {
|
|
137
|
+
return unwrap(await this.http.fetch("POST", "/me/subscription/resume", {}, { bearerToken: accessToken }));
|
|
138
|
+
}
|
|
121
139
|
};
|
|
122
140
|
function createReoptPlansClient(config) {
|
|
123
141
|
return new ReoptPlansClient(config);
|
|
@@ -125,4 +143,4 @@ function createReoptPlansClient(config) {
|
|
|
125
143
|
|
|
126
144
|
//#endregion
|
|
127
145
|
export { createReoptPlansClient as n, ReoptPlansClient as t };
|
|
128
|
-
//# sourceMappingURL=client-
|
|
146
|
+
//# sourceMappingURL=client-CLsqp1Jn.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-DIewtTz2.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-COlwskCB.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-Cb96ydFD.js";
|
|
2
|
+
import { t as BaseHttpClient } from "./http-client-DIewtTz2.js";
|
|
3
|
+
import { t as buildQuery } from "./query-jbkDQ1o2.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-DEMD0Wo5.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as SDK_VERSION } from "./config-
|
|
1
|
+
import { n as SDK_VERSION } from "./config-Cb96ydFD.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-t7ASsw2Q.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-DMvufVds.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-DIewtTz2.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-DVIuxsN7.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
1
|
+
import { t as BaseHttpClient } from "./http-client-DIewtTz2.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-DZZEzs2l.js.map
|
|
@@ -268,8 +268,24 @@ declare class ReoptPlansClient {
|
|
|
268
268
|
* retry).
|
|
269
269
|
*/
|
|
270
270
|
changePlan(planId: string, accessToken: string): Promise<CurrentPlan>;
|
|
271
|
+
/**
|
|
272
|
+
* Resume the current customer's canceled subscription while its paid period
|
|
273
|
+
* is still running (Lemon Squeezy, since 4.7) — the same provider
|
|
274
|
+
* subscription continues with its renewal date. Resolves to the resumed plan
|
|
275
|
+
* (same shape as {@link getMyPlan}).
|
|
276
|
+
*
|
|
277
|
+
* During that period {@link createCheckout} refuses with
|
|
278
|
+
* `SUBSCRIPTION_CANCEL_PENDING` (409): a new checkout would start a second
|
|
279
|
+
* subscription and bill the overlap twice. Resume instead, then
|
|
280
|
+
* {@link changePlan} if the customer wants another plan.
|
|
281
|
+
*
|
|
282
|
+
* Errors (`ReoptSDKError.code`): `NO_RESUMABLE_SUBSCRIPTION` (409 — nothing
|
|
283
|
+
* canceled, or the paid period is over), `PROVIDER_ERROR` (HTTP 502 —
|
|
284
|
+
* nothing changed, retry).
|
|
285
|
+
*/
|
|
286
|
+
resume(accessToken: string): Promise<CurrentPlan>;
|
|
271
287
|
}
|
|
272
288
|
declare function createReoptPlansClient(config: ReoptSDKConfig): ReoptPlansClient;
|
|
273
289
|
//#endregion
|
|
274
290
|
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 };
|
|
275
|
-
//# sourceMappingURL=client-
|
|
291
|
+
//# sourceMappingURL=client-Dsz0BzpO.d.ts.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-Cb96ydFD.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-DIewtTz2.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-UI1-_F9P.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as resolveIdBaseUrl } from "./config-
|
|
1
|
+
import { a as resolveIdBaseUrl } from "./config-Cb96ydFD.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-t7ASsw2Q.js.map
|
package/dist/cms/index.js
CHANGED
|
@@ -322,7 +322,7 @@ function mapHttpStatusToError(status, code, message, ctx, fieldErrors) {
|
|
|
322
322
|
|
|
323
323
|
//#endregion
|
|
324
324
|
//#region src/core/config.ts
|
|
325
|
-
const SDK_VERSION = "4.7.0-rc.
|
|
325
|
+
const SDK_VERSION = "4.7.0-rc.6";
|
|
326
326
|
/**
|
|
327
327
|
* Default API host for EAV / AI / Files / CMS / Terms. Consumers can override
|
|
328
328
|
* via `config.baseUrl` or the `REOPT_BASE_URL` env var.
|
|
@@ -504,4 +504,4 @@ function deriveIdFromBaseUrl(baseUrl) {
|
|
|
504
504
|
|
|
505
505
|
//#endregion
|
|
506
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 };
|
|
507
|
-
//# sourceMappingURL=config-
|
|
507
|
+
//# sourceMappingURL=config-Cb96ydFD.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 { 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-Cb96ydFD.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-DEMD0Wo5.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 { 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-Cb96ydFD.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-DIewtTz2.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-Dsz0BzpO.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-VolJHcFS.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-Bi-KSU_r.js";
|
|
3
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-VolJHcFS.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-Cb96ydFD.js";
|
|
2
|
+
import { t as BaseHttpClient } from "./http-client-DIewtTz2.js";
|
|
3
|
+
import { n as createReoptAiClient } from "./client-BrR3dzC_.js";
|
|
4
|
+
import { n as createReoptAuthClient } from "./client-DZZEzs2l.js";
|
|
5
|
+
import { t as createReoptCmsClient } from "./client-4x4xlk9N.js";
|
|
6
|
+
import { t as createReoptEavClient } from "./client-DEMD0Wo5.js";
|
|
7
|
+
import { n as createReoptFeedbackClient } from "./client-DVIuxsN7.js";
|
|
8
|
+
import { n as createReoptFileClient } from "./client-UI1-_F9P.js";
|
|
9
|
+
import { n as createReoptAnalyticsClient } from "./client-COlwskCB.js";
|
|
10
|
+
import { n as createReoptPlansClient } from "./client-CLsqp1Jn.js";
|
|
11
|
+
import { n as createReoptPushClient } from "./client-C7k9bCwh.js";
|
|
12
|
+
import { n as createReoptTermsClient } from "./client-C1yI9DiK.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-Cb96ydFD.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-t7ASsw2Q.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-DMvufVds.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-t7ASsw2Q.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-Dsz0BzpO.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-Cb96ydFD.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-jbkDQ1o2.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 { 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-VolJHcFS.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-VolJHcFS.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-DMvufVds.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
|
@@ -643,13 +643,21 @@ canceled.providerCanceled; // false → local subscription is definitely over (n
|
|
|
643
643
|
// Switch plans while subscribed (Lemon Squeezy, 4.7+) — no new checkout.
|
|
644
644
|
// Immediate; resolves to the changed plan (same shape as getMyPlan).
|
|
645
645
|
// Upgrades charge the prorated difference now, downgrades credit the next invoice.
|
|
646
|
-
const plan: CurrentPlan = await sdk.plans.changePlan(
|
|
647
|
-
plan.planId; //
|
|
646
|
+
const plan: CurrentPlan = await sdk.plans.changePlan(proPlanId, accessToken);
|
|
647
|
+
plan.planId; // proPlanId
|
|
648
648
|
// e.code: NO_ACTIVE_SUBSCRIPTION | SAME_PLAN | PLAN_NOT_FOUND | PLAN_INACTIVE |
|
|
649
649
|
// PLAN_PRICE_NOT_LINKED | TERMS_REQUIRED | SUBSCRIPTION_NOT_ACTIVE |
|
|
650
650
|
// PROVIDER_PORTAL_REQUIRED (PayPal → provider portal) | PROVIDER_ERROR (502, retry)
|
|
651
651
|
```
|
|
652
652
|
|
|
653
|
+
```ts
|
|
654
|
+
// Resume a canceled subscription while its paid period runs (Lemon Squeezy, 4.7+).
|
|
655
|
+
// During that period createCheckout refuses with SUBSCRIPTION_CANCEL_PENDING (409) —
|
|
656
|
+
// a second subscription would bill the overlap twice. Resume, then changePlan if needed.
|
|
657
|
+
const resumed: CurrentPlan = await sdk.plans.resume(accessToken);
|
|
658
|
+
// e.code: NO_RESUMABLE_SUBSCRIPTION (409) | PROVIDER_ERROR (502, retry)
|
|
659
|
+
```
|
|
660
|
+
|
|
653
661
|
> The three fields added in 3.4 are optional — an older platform deployment
|
|
654
662
|
> simply omits them. Apple/Google (IAP) subscriptions are canceled in the store,
|
|
655
663
|
> so no remote call is made and `providerCanceled` stays `false`.
|
package/docs/errors.md
CHANGED
|
@@ -266,21 +266,23 @@ try {
|
|
|
266
266
|
}
|
|
267
267
|
```
|
|
268
268
|
|
|
269
|
-
### Plan change &
|
|
269
|
+
### Plan change, cancel & resume (`sdk.plans.changePlan` / `cancel` / `resume`, 4.7+)
|
|
270
270
|
|
|
271
271
|
Refusals come back as `ConflictError` (409) with these `code`s — nothing was
|
|
272
272
|
changed and no provider call was made:
|
|
273
273
|
|
|
274
|
-
| code | meaning
|
|
275
|
-
| --------------------------------------- |
|
|
276
|
-
| `NO_ACTIVE_SUBSCRIPTION` | no subscription to change
|
|
277
|
-
| `SAME_PLAN` | already on that plan
|
|
278
|
-
| `PLAN_INACTIVE` / `PLAN_SCOPE_MISMATCH` | the target plan is not sellable here
|
|
279
|
-
| `PLAN_CHANGE_UNSUPPORTED` | not a Lemon Squeezy subscription, or a different currency / non-recurring plan
|
|
280
|
-
| `PLAN_PRICE_NOT_LINKED` | the plan has no provider price yet
|
|
281
|
-
| `TERMS_REQUIRED` | the new plan needs terms consent
|
|
282
|
-
| `SUBSCRIPTION_NOT_ACTIVE` | cancel scheduled or payment past due
|
|
283
|
-
| `PROVIDER_PORTAL_REQUIRED` | PayPal subscription — the provider API cannot change it
|
|
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
|
+
| `NO_RESUMABLE_SUBSCRIPTION` | `resume` — nothing canceled, or the paid period is over | check out again |
|
|
285
|
+
| `SUBSCRIPTION_CANCEL_PENDING` | `createCheckout` — a canceled subscription still runs its paid period; a new one would bill the overlap twice | `resume`, then `changePlan` for another plan |
|
|
284
286
|
|
|
285
287
|
`PLAN_NOT_FOUND` is a `NotFoundError` (404). A provider-side failure is a
|
|
286
288
|
`ServerError` with `status: 502` and `code: "PROVIDER_ERROR"` (changePlan) or
|