@bounded-sh/client 0.0.60 → 0.0.62
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/dist/auth/bounded-login-widget.d.ts +1 -1
- package/dist/auth/index.d.ts +4 -5
- package/dist/{email-auth-provider-BCEdcnRu.js → email-auth-provider-BttT2sZK.js} +2 -2
- package/dist/{email-auth-provider-BCEdcnRu.js.map → email-auth-provider-BttT2sZK.js.map} +1 -1
- package/dist/{email-auth-provider-B5yIZe1l.js → email-auth-provider-BxV1zZA_.js} +2 -2
- package/dist/{email-auth-provider-B5yIZe1l.js.map → email-auth-provider-BxV1zZA_.js.map} +1 -1
- package/dist/{email-auth-provider-BF-vvbAt.mjs → email-auth-provider-Cb4VKA1E.mjs} +2 -2
- package/dist/{email-auth-provider-BF-vvbAt.mjs.map → email-auth-provider-Cb4VKA1E.mjs.map} +1 -1
- package/dist/{email-auth-provider-nBv7mW9q.mjs → email-auth-provider-vWv0rnbd.mjs} +2 -2
- package/dist/{email-auth-provider-nBv7mW9q.mjs.map → email-auth-provider-vWv0rnbd.mjs.map} +1 -1
- package/dist/{guest-auth-provider-DFNAHmtY.mjs → guest-auth-provider-BBPpydtM.mjs} +2 -2
- package/dist/{guest-auth-provider-DFNAHmtY.mjs.map → guest-auth-provider-BBPpydtM.mjs.map} +1 -1
- package/dist/{guest-auth-provider-CrRreOyf.js → guest-auth-provider-BcR-MQ0g.js} +2 -2
- package/dist/{guest-auth-provider-CrRreOyf.js.map → guest-auth-provider-BcR-MQ0g.js.map} +1 -1
- package/dist/{guest-auth-provider-DGvQgIwm.mjs → guest-auth-provider-CeIZw5x6.mjs} +2 -2
- package/dist/{guest-auth-provider-DGvQgIwm.mjs.map → guest-auth-provider-CeIZw5x6.mjs.map} +1 -1
- package/dist/{guest-auth-provider-CZ-CpNhD.js → guest-auth-provider-peD5Zasl.js} +2 -2
- package/dist/{guest-auth-provider-CZ-CpNhD.js.map → guest-auth-provider-peD5Zasl.js.map} +1 -1
- package/dist/{index-iu8vB4ye.js → index-DEDYfO2p.js} +51 -22
- package/dist/index-DEDYfO2p.js.map +1 -0
- package/dist/{index-CQtGkKVd.mjs → index-DpJl_Cpa.mjs} +51 -22
- package/dist/index-DpJl_Cpa.mjs.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{index.native-Crfn_NOB.mjs → index.native-BIUs8t7F.mjs} +38 -15
- package/dist/index.native-BIUs8t7F.mjs.map +1 -0
- package/dist/{index.native-CDfx0N6p.js → index.native-BSheiGj2.js} +38 -15
- package/dist/index.native-BSheiGj2.js.map +1 -0
- package/dist/index.native.js +1 -1
- package/dist/index.native.mjs +1 -1
- package/dist/{injected-evm-wallet-provider-CGa692L1.js → injected-evm-wallet-provider-7XawIUdJ.js} +2 -2
- package/dist/{injected-evm-wallet-provider-CGa692L1.js.map → injected-evm-wallet-provider-7XawIUdJ.js.map} +1 -1
- package/dist/{injected-evm-wallet-provider-LTWiACl5.js → injected-evm-wallet-provider-B-9VXQcH.js} +2 -2
- package/dist/{injected-evm-wallet-provider-LTWiACl5.js.map → injected-evm-wallet-provider-B-9VXQcH.js.map} +1 -1
- package/dist/{injected-evm-wallet-provider-D8lYGcM2.mjs → injected-evm-wallet-provider-BVsxOzYr.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-D8lYGcM2.mjs.map → injected-evm-wallet-provider-BVsxOzYr.mjs.map} +1 -1
- package/dist/{injected-evm-wallet-provider-Bi9G3X35.mjs → injected-evm-wallet-provider-DnOrVMDX.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-Bi9G3X35.mjs.map → injected-evm-wallet-provider-DnOrVMDX.mjs.map} +1 -1
- package/dist/{injected-wallet-provider-TPx8Wzvq.js → injected-wallet-provider-BMDJntMD.js} +2 -2
- package/dist/{injected-wallet-provider-TPx8Wzvq.js.map → injected-wallet-provider-BMDJntMD.js.map} +1 -1
- package/dist/{injected-wallet-provider-kx8tcMKM.mjs → injected-wallet-provider-Bqk33sir.mjs} +2 -2
- package/dist/{injected-wallet-provider-kx8tcMKM.mjs.map → injected-wallet-provider-Bqk33sir.mjs.map} +1 -1
- package/dist/{injected-wallet-provider-DYZFxIdd.js → injected-wallet-provider-D574oPzH.js} +2 -2
- package/dist/{injected-wallet-provider-DYZFxIdd.js.map → injected-wallet-provider-D574oPzH.js.map} +1 -1
- package/dist/{injected-wallet-provider-CcyA5JBS.mjs → injected-wallet-provider-ZkPzVj5W.mjs} +2 -2
- package/dist/{injected-wallet-provider-CcyA5JBS.mjs.map → injected-wallet-provider-ZkPzVj5W.mjs.map} +1 -1
- package/package.json +2 -2
- package/dist/index-CQtGkKVd.mjs.map +0 -1
- package/dist/index-iu8vB4ye.js.map +0 -1
- package/dist/index.native-CDfx0N6p.js.map +0 -1
- package/dist/index.native-Crfn_NOB.mjs.map +0 -1
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a2 as BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA, a1 as BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA, a0 as BUILD_REVIEW_CAPABILITY_SCHEMA, W as BuildsApiError, $ as FAILURE_REASONS, X as NON_TERMINAL_STATES, S as OffchainAuthProvider, _ as PARK_REASONS, T as PrivyExpoProvider, Z as RUN_STATES, Y as TERMINAL_STATES, I as apps, V as builds, A as completeLoginFromRedirect, C as completeLoginInPopup, k as defaultInjectedEvmProvider, d as defaultInjectedProvider, J as deserializeTransaction, q as getAuthLoading, v as getAuthProvider, m as getCurrentUser, N as getIdToken, L as getOrCreateTurnkeyWallet, g as getPlatform, l as init, t as login, B as loginWithPopup, x as loginWithPrivy, z as loginWithRedirect, y as loginWithWallet, u as logout, p as onAuthLoadingChanged, o as onAuthStateChanged, O as onramp, P as onrampQuote, Q as onrampStatus, D as openBoundedWidget, U as requestEip6963Providers, R as setPlatform, w as signInAnonymously, K as signSolanaMessageViaTurnkey, M as startTurnkeyEmailLogin, F as useAuth, H as useBuildRun, G as useQuery } from './index-
|
|
1
|
+
export { a2 as BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA, a1 as BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA, a0 as BUILD_REVIEW_CAPABILITY_SCHEMA, W as BuildsApiError, $ as FAILURE_REASONS, X as NON_TERMINAL_STATES, S as OffchainAuthProvider, _ as PARK_REASONS, T as PrivyExpoProvider, Z as RUN_STATES, Y as TERMINAL_STATES, I as apps, V as builds, A as completeLoginFromRedirect, C as completeLoginInPopup, k as defaultInjectedEvmProvider, d as defaultInjectedProvider, J as deserializeTransaction, q as getAuthLoading, v as getAuthProvider, m as getCurrentUser, N as getIdToken, L as getOrCreateTurnkeyWallet, g as getPlatform, l as init, t as login, B as loginWithPopup, x as loginWithPrivy, z as loginWithRedirect, y as loginWithWallet, u as logout, p as onAuthLoadingChanged, o as onAuthStateChanged, O as onramp, P as onrampQuote, Q as onrampStatus, D as openBoundedWidget, U as requestEip6963Providers, R as setPlatform, w as signInAnonymously, K as signSolanaMessageViaTurnkey, M as startTurnkeyEmailLogin, F as useAuth, H as useBuildRun, G as useQuery } from './index-DpJl_Cpa.mjs';
|
|
2
2
|
export * from '@bounded-sh/core';
|
|
3
3
|
export { BoundedDeclineError, DECLINE_EVENT_NAME, RATE_LIMIT_EVENT_NAME, ScopedClientReadOnlyError, aggregate, count, createClient, deriveDecline, dispatchDeclineEvent, dispatchRateLimitEvent, docId, get, getConfig, getFiles, getMany, queryAggregate, runExpression, runExpressionMany, runQuery, runQueryMany, search, set, setFile, setMany, signAndSubmitTransaction, signMessage, signTransaction, subscribe } from '@bounded-sh/core';
|
|
4
4
|
import 'react';
|
|
@@ -3686,6 +3686,7 @@ const OIDC_NO_WALLET = 'This login has no embedded wallet. Enable `"auth": { "wa
|
|
|
3686
3686
|
'then sign from a user gesture.';
|
|
3687
3687
|
const PKCE_STORE_KEY = 'bounded.oidc.pkce';
|
|
3688
3688
|
const STORED_AUTH_METHOD_KEY$1 = 'bounded_last_auth_method';
|
|
3689
|
+
const ISSUER_SESSION_KIND_KEY$1 = 'bounded_issuer_session_kind';
|
|
3689
3690
|
// Active session store (Web on web, RN on React Native) — selected by config,
|
|
3690
3691
|
// not by `typeof window` (truthy on RN). OIDC redirect/popup is web-only, but the
|
|
3691
3692
|
// session it mints is read back through this same selector everywhere.
|
|
@@ -4192,6 +4193,13 @@ async function exchangeCode(code, verifier, redirectUri) {
|
|
|
4192
4193
|
getPlatform().storage.setItem(STORED_AUTH_METHOD_KEY$1, 'email');
|
|
4193
4194
|
}
|
|
4194
4195
|
catch ( /* storage unavailable */_b) { /* storage unavailable */ }
|
|
4196
|
+
// OIDC login does establish the issuer's Better Auth browser cookie. Record
|
|
4197
|
+
// that fact separately from the provider name so logout clears the cookie
|
|
4198
|
+
// and returns through the registered app origin.
|
|
4199
|
+
try {
|
|
4200
|
+
getPlatform().storage.setItem(ISSUER_SESSION_KIND_KEY$1, 'hosted');
|
|
4201
|
+
}
|
|
4202
|
+
catch ( /* storage unavailable */_c) { /* storage unavailable */ }
|
|
4195
4203
|
setCurrentUser(user);
|
|
4196
4204
|
setAuthProviderInstance(oidcProviderSingleton);
|
|
4197
4205
|
return user;
|
|
@@ -4208,6 +4216,7 @@ const objectIdentityKeys = new WeakMap();
|
|
|
4208
4216
|
let nextObjectIdentityKey = 1;
|
|
4209
4217
|
// --- localStorage helpers: track which auth method created the active session ---
|
|
4210
4218
|
const STORED_AUTH_METHOD_KEY = 'bounded_last_auth_method';
|
|
4219
|
+
const ISSUER_SESSION_KIND_KEY = 'bounded_issuer_session_kind';
|
|
4211
4220
|
function getStoredAuthMethod() {
|
|
4212
4221
|
try {
|
|
4213
4222
|
return getPlatform().storage.getItem(STORED_AUTH_METHOD_KEY);
|
|
@@ -4224,11 +4233,25 @@ function setStoredAuthMethod(method) {
|
|
|
4224
4233
|
else {
|
|
4225
4234
|
getPlatform().storage.removeItem(STORED_AUTH_METHOD_KEY);
|
|
4226
4235
|
}
|
|
4236
|
+
// Non-email providers cannot own a Better Auth browser session. Clear
|
|
4237
|
+
// any prior hosted/inline classification when the active provider is
|
|
4238
|
+
// replaced or the session is removed.
|
|
4239
|
+
if (method !== 'email') {
|
|
4240
|
+
getPlatform().storage.removeItem(ISSUER_SESSION_KIND_KEY);
|
|
4241
|
+
}
|
|
4227
4242
|
}
|
|
4228
4243
|
catch (_a) {
|
|
4229
4244
|
// storage might not be available
|
|
4230
4245
|
}
|
|
4231
4246
|
}
|
|
4247
|
+
function getIssuerSessionKind() {
|
|
4248
|
+
try {
|
|
4249
|
+
return getPlatform().storage.getItem(ISSUER_SESSION_KIND_KEY);
|
|
4250
|
+
}
|
|
4251
|
+
catch (_a) {
|
|
4252
|
+
return null;
|
|
4253
|
+
}
|
|
4254
|
+
}
|
|
4232
4255
|
function getStoredIdToken() {
|
|
4233
4256
|
try {
|
|
4234
4257
|
return getActiveSessionManager().getIdToken();
|
|
@@ -4453,7 +4476,7 @@ async function getAuthProvider(config) {
|
|
|
4453
4476
|
// manager as legacy email sessions. Human login should be started
|
|
4454
4477
|
// with loginWithRedirect(); this provider is kept as the restore and
|
|
4455
4478
|
// logout surface for those sessions.
|
|
4456
|
-
currentAuthProvider = new (await import('./email-auth-provider-
|
|
4479
|
+
currentAuthProvider = new (await import('./email-auth-provider-Cb4VKA1E.mjs')).EmailAuthProvider();
|
|
4457
4480
|
break;
|
|
4458
4481
|
case "wallet":
|
|
4459
4482
|
case "phantom": {
|
|
@@ -4472,7 +4495,7 @@ async function getAuthProvider(config) {
|
|
|
4472
4495
|
if (!isWalletLoginEnabled(config)) {
|
|
4473
4496
|
throw walletLoginNotEnabledError(authMethod);
|
|
4474
4497
|
}
|
|
4475
|
-
const { InjectedWalletProvider } = await import('./injected-wallet-provider-
|
|
4498
|
+
const { InjectedWalletProvider } = await import('./injected-wallet-provider-ZkPzVj5W.mjs');
|
|
4476
4499
|
currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
|
|
4477
4500
|
break;
|
|
4478
4501
|
}
|
|
@@ -4485,7 +4508,7 @@ async function getAuthProvider(config) {
|
|
|
4485
4508
|
// Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
|
|
4486
4509
|
// to point at a specific wallet or set chainId/domain.
|
|
4487
4510
|
const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
|
|
4488
|
-
const { InjectedEvmWalletProvider } = await import('./injected-evm-wallet-provider-
|
|
4511
|
+
const { InjectedEvmWalletProvider } = await import('./injected-evm-wallet-provider-DnOrVMDX.mjs');
|
|
4489
4512
|
currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
|
|
4490
4513
|
break;
|
|
4491
4514
|
}
|
|
@@ -4513,7 +4536,7 @@ async function getAuthProvider(config) {
|
|
|
4513
4536
|
break;
|
|
4514
4537
|
case "guest":
|
|
4515
4538
|
// Anonymous auth: a device-local ed25519 keypair signs the challenge.
|
|
4516
|
-
currentAuthProvider = new (await import('./guest-auth-provider-
|
|
4539
|
+
currentAuthProvider = new (await import('./guest-auth-provider-BBPpydtM.mjs')).GuestAuthProvider();
|
|
4517
4540
|
break;
|
|
4518
4541
|
}
|
|
4519
4542
|
if (!currentAuthProvider) {
|
|
@@ -4569,7 +4592,7 @@ async function signInAnonymously() {
|
|
|
4569
4592
|
// Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
|
|
4570
4593
|
// the main bundle for data-only apps. Specifier is a static string literal
|
|
4571
4594
|
// so bundle-splitting can see it.
|
|
4572
|
-
const provider = new (await import('./guest-auth-provider-
|
|
4595
|
+
const provider = new (await import('./guest-auth-provider-BBPpydtM.mjs')).GuestAuthProvider();
|
|
4573
4596
|
setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
|
|
4574
4597
|
const commit = (user) => {
|
|
4575
4598
|
// No await/interleaving inside this block: provider/method/config/marker
|
|
@@ -4827,15 +4850,15 @@ async function logout$1(options) {
|
|
|
4827
4850
|
const idTokenHint = idTokenHintOrNull(sm);
|
|
4828
4851
|
if (refreshToken)
|
|
4829
4852
|
await revokeSession(refreshToken, sessionIssuer !== null && sessionIssuer !== void 0 ? sessionIssuer : undefined);
|
|
4830
|
-
//
|
|
4831
|
-
//
|
|
4832
|
-
//
|
|
4833
|
-
//
|
|
4834
|
-
//
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4853
|
+
// Only OIDC-hosted sessions own an issuer browser cookie. Turnkey-native
|
|
4854
|
+
// email OTP is also an email auth method, but it mints the app session
|
|
4855
|
+
// inline and has no issuer cookie to clear. Use the explicit session-kind
|
|
4856
|
+
// marker when present. The auth-method fallback preserves correct logout
|
|
4857
|
+
// behavior for hosted sessions created by older SDK versions.
|
|
4858
|
+
const issuerSessionKind = getIssuerSessionKind();
|
|
4859
|
+
const wasHosted = issuerSessionKind === 'hosted'
|
|
4860
|
+
|| (issuerSessionKind === null
|
|
4861
|
+
&& (currentAuthMethod === 'email' || getStoredAuthMethod() === 'email'));
|
|
4839
4862
|
await currentAuthProvider.logout();
|
|
4840
4863
|
setStoredAuthMethod(null);
|
|
4841
4864
|
currentAuthProvider = null;
|
|
@@ -6396,4 +6419,4 @@ class PrivyExpoProvider {
|
|
|
6396
6419
|
}
|
|
6397
6420
|
|
|
6398
6421
|
export { useAuth as A, useQuery as B, useBuildRun as C, apps as D, EMBEDDED_WALLET_UNSUPPORTED as E, deserializeTransaction as F, getIdToken as G, onramp as H, onrampQuote as I, onrampStatus as J, setPlatform as K, builds as L, BuildsApiError as M, NON_TERMINAL_STATES as N, OffchainAuthProvider as O, PrivyExpoProvider as P, PARK_REASONS as Q, RUN_STATES as R, FAILURE_REASONS as S, TERMINAL_STATES as T, BUILD_REVIEW_CAPABILITY_SCHEMA as U, BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA as V, BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA as W, hasEmbeddedEvmWallet as a, embeddedSignAndSubmit as b, setAuthLoading as c, bufferExports as d, embeddedRunEvmTransaction as e, bs58 as f, getPlatform as g, hasEmbeddedWallet as h, confirmAndCheckTransaction as i, init as j, getCurrentUser as k, onAuthLoadingChanged as l, getAuthLoading as m, normalizeSolanaRpcUrl as n, onAuthStateChanged as o, login as p, logout as q, resolveSolanaRpcUrl as r, setCurrentUser as s, getAuthProvider as t, signInAnonymously as u, loginWithPrivy as v, loginWithRedirect as w, completeLoginFromRedirect as x, loginWithPopup as y, completeLoginInPopup as z };
|
|
6399
|
-
//# sourceMappingURL=index.native-
|
|
6422
|
+
//# sourceMappingURL=index.native-BIUs8t7F.mjs.map
|