@bounded-sh/client 0.0.119 → 0.0.120-expo.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/auth/oidc-auth.d.ts +2 -1
  2. package/dist/{email-auth-provider-wOISnCic.js → email-auth-provider-Bb_0mHJ_.js} +2 -2
  3. package/dist/{email-auth-provider-wOISnCic.js.map → email-auth-provider-Bb_0mHJ_.js.map} +1 -1
  4. package/dist/{email-auth-provider-DyzhiN9Y.js → email-auth-provider-IsiArtx0.js} +2 -2
  5. package/dist/{email-auth-provider-DyzhiN9Y.js.map → email-auth-provider-IsiArtx0.js.map} +1 -1
  6. package/dist/{email-auth-provider-DHq5_wtn.mjs → email-auth-provider-TA2AbU5Y.mjs} +2 -2
  7. package/dist/{email-auth-provider-DHq5_wtn.mjs.map → email-auth-provider-TA2AbU5Y.mjs.map} +1 -1
  8. package/dist/{email-auth-provider-DOI-4lPC.mjs → email-auth-provider-ao5ce_SN.mjs} +2 -2
  9. package/dist/{email-auth-provider-DOI-4lPC.mjs.map → email-auth-provider-ao5ce_SN.mjs.map} +1 -1
  10. package/dist/{guest-auth-provider-xap-VQBP.js → guest-auth-provider-CJUbifdu.js} +2 -2
  11. package/dist/{guest-auth-provider-xap-VQBP.js.map → guest-auth-provider-CJUbifdu.js.map} +1 -1
  12. package/dist/{guest-auth-provider-Br3iM3O3.js → guest-auth-provider-DTEwf7qP.js} +2 -2
  13. package/dist/{guest-auth-provider-Br3iM3O3.js.map → guest-auth-provider-DTEwf7qP.js.map} +1 -1
  14. package/dist/{guest-auth-provider-DyP5UUg6.mjs → guest-auth-provider-Dw-bF10B.mjs} +2 -2
  15. package/dist/{guest-auth-provider-ZOBNFoeC.mjs.map → guest-auth-provider-Dw-bF10B.mjs.map} +1 -1
  16. package/dist/{guest-auth-provider-ZOBNFoeC.mjs → guest-auth-provider-DxQG3JvU.mjs} +2 -2
  17. package/dist/{guest-auth-provider-DyP5UUg6.mjs.map → guest-auth-provider-DxQG3JvU.mjs.map} +1 -1
  18. package/dist/{index-BaXUWG8Q.mjs → index-BdzGX8fS.mjs} +36 -14
  19. package/dist/index-BdzGX8fS.mjs.map +1 -0
  20. package/dist/{index-B4_eKphx.js → index-KUBcQdTX.js} +36 -14
  21. package/dist/index-KUBcQdTX.js.map +1 -0
  22. package/dist/index.js +1 -1
  23. package/dist/index.mjs +1 -1
  24. package/dist/{index.native-B-pjNetI.js → index.native-CZSRvIAb.js} +35 -13
  25. package/dist/index.native-CZSRvIAb.js.map +1 -0
  26. package/dist/{index.native-B4yI0BqT.mjs → index.native-N5zxPEYK.mjs} +35 -13
  27. package/dist/index.native-N5zxPEYK.mjs.map +1 -0
  28. package/dist/index.native.js +1 -1
  29. package/dist/index.native.mjs +1 -1
  30. package/dist/{injected-evm-wallet-provider-CKAv4Qxh.js → injected-evm-wallet-provider--XJFh-7d.js} +2 -2
  31. package/dist/{injected-evm-wallet-provider-CKAv4Qxh.js.map → injected-evm-wallet-provider--XJFh-7d.js.map} +1 -1
  32. package/dist/{injected-evm-wallet-provider-DQMYqPus.js → injected-evm-wallet-provider-4T_-2UQI.js} +2 -2
  33. package/dist/{injected-evm-wallet-provider-DQMYqPus.js.map → injected-evm-wallet-provider-4T_-2UQI.js.map} +1 -1
  34. package/dist/{injected-evm-wallet-provider-B4Kr6lnK.mjs → injected-evm-wallet-provider-BlSFIzEA.mjs} +2 -2
  35. package/dist/{injected-evm-wallet-provider-B4Kr6lnK.mjs.map → injected-evm-wallet-provider-BlSFIzEA.mjs.map} +1 -1
  36. package/dist/{injected-evm-wallet-provider-Vw-Puwxh.mjs → injected-evm-wallet-provider-CtPPhtMh.mjs} +2 -2
  37. package/dist/{injected-evm-wallet-provider-Vw-Puwxh.mjs.map → injected-evm-wallet-provider-CtPPhtMh.mjs.map} +1 -1
  38. package/dist/{injected-wallet-provider-jj9dqm2Z.mjs → injected-wallet-provider-Bnsfazum.mjs} +2 -2
  39. package/dist/{injected-wallet-provider-jj9dqm2Z.mjs.map → injected-wallet-provider-Bnsfazum.mjs.map} +1 -1
  40. package/dist/{injected-wallet-provider-B8QTPxf6.js → injected-wallet-provider-CJ0v5Sgn.js} +2 -2
  41. package/dist/{injected-wallet-provider-B8QTPxf6.js.map → injected-wallet-provider-CJ0v5Sgn.js.map} +1 -1
  42. package/dist/{injected-wallet-provider-BsTfBAD4.js → injected-wallet-provider-Ckljhcbu.js} +2 -2
  43. package/dist/{injected-wallet-provider-BsTfBAD4.js.map → injected-wallet-provider-Ckljhcbu.js.map} +1 -1
  44. package/dist/{injected-wallet-provider-CQxGVYja.mjs → injected-wallet-provider-yyJfuVgv.mjs} +2 -2
  45. package/dist/{injected-wallet-provider-CQxGVYja.mjs.map → injected-wallet-provider-yyJfuVgv.mjs.map} +1 -1
  46. package/package.json +2 -2
  47. package/dist/index-B4_eKphx.js.map +0 -1
  48. package/dist/index-BaXUWG8Q.mjs.map +0 -1
  49. package/dist/index.native-B-pjNetI.js.map +0 -1
  50. package/dist/index.native-B4yI0BqT.mjs.map +0 -1
@@ -158,8 +158,17 @@ function createWebPlatform() {
158
158
  // bundlers do not externalize or preload a Node-only module in the
159
159
  // email/guest graph; this branch is unreachable when WebCrypto is
160
160
  // available (all supported browsers and current Node releases).
161
+ // The try makes it an optional dependency for Metro, whose production
162
+ // constant folding turns the specifier back into a literal: a React Native
163
+ // app with no node:crypto mapping still bundles (it passes setPlatform({ sha256 })).
161
164
  const nodeCryptoSpecifier = 'node:crypto';
162
- const { createHash } = await import(/* @vite-ignore */ nodeCryptoSpecifier);
165
+ let createHash;
166
+ try {
167
+ ({ createHash } = await import(/* @vite-ignore */ nodeCryptoSpecifier));
168
+ }
169
+ catch (_b) {
170
+ throw new Error('SHA-256 needs WebCrypto here: pass setPlatform({ sha256 }) (e.g. expo-crypto digest).');
171
+ }
163
172
  const hash = createHash('sha256').update(data).digest();
164
173
  return hash.buffer.slice(hash.byteOffset, hash.byteOffset + hash.byteLength);
165
174
  },
@@ -5522,6 +5531,14 @@ function cleanCallbackUrl(url) {
5522
5531
  clean.searchParams.delete(key);
5523
5532
  return clean;
5524
5533
  }
5534
+ // The address a code returned to, without the fragment. The issuer never sets one
5535
+ // (redirectUri may not carry one), but a browser can keep one across the redirect
5536
+ // chain: iOS lands a Google sign-in on `<redirectUri>?code=...#`.
5537
+ function returnAddress(url) {
5538
+ const clean = cleanCallbackUrl(url);
5539
+ clean.hash = '';
5540
+ return clean.href;
5541
+ }
5525
5542
  async function validateAttempt(pkce, callback) {
5526
5543
  const cfg = await core.getConfig();
5527
5544
  if (!pkce || typeof pkce.verifier !== 'string' || !pkce.verifier ||
@@ -5531,7 +5548,7 @@ async function validateAttempt(pkce, callback) {
5531
5548
  if (!Number.isFinite(pkce.createdAt) || Date.now() - pkce.createdAt > LOGIN_TIMEOUT_MS || pkce.createdAt > Date.now()) {
5532
5549
  throw new Error('Login expired. Start sign-in again.');
5533
5550
  }
5534
- if (callback && (cleanCallbackUrl(callback).href !== cleanCallbackUrl(new URL(pkce.redirectUri)).href ||
5551
+ if (callback && (returnAddress(callback) !== returnAddress(new URL(pkce.redirectUri)) ||
5535
5552
  (callback.searchParams.has('iss') && callback.searchParams.get('iss') !== pkce.issuer))) {
5536
5553
  throw new Error('Login returned to a different address or from a different auth server. Start sign-in again.');
5537
5554
  }
@@ -5784,7 +5801,7 @@ function parseCallbackParams(callbackUrl) {
5784
5801
  // universal-link callback, verify state, and run the SAME PKCE code→token exchange
5785
5802
  // as web. Returns the signed-in User inline; web redirects complete on the next init().
5786
5803
  async function runNativeLogin(opts) {
5787
- var _a, _b;
5804
+ var _a, _b, _c, _d;
5788
5805
  const { url, pkce } = await buildAuthorize(opts);
5789
5806
  const WebBrowser = await loadExpoWebBrowser();
5790
5807
  const openAuthSession = WebBrowser.openAuthSessionAsync || ((_a = WebBrowser.default) === null || _a === void 0 ? void 0 : _a.openAuthSessionAsync);
@@ -5796,12 +5813,16 @@ async function runNativeLogin(opts) {
5796
5813
  // openAuthSessionAsync keeps JS alive while the system browser is shown, then
5797
5814
  // resolves with the callback URL once the universal link fires — so `pkce`
5798
5815
  // stays in scope and never needs to be persisted.
5799
- const result = await openAuthSession(url, opts.redirectUri);
5816
+ // iOS (17.4+) only returns an https callback to the app when asked to; without it the
5817
+ // sheet treats "https" as a custom scheme and never completes. A custom scheme callback
5818
+ // (an Expo Go preview's exps://) is caught by its scheme either way.
5819
+ const preferUniversalLinks = (_c = (_b = opts.redirectUri) === null || _b === void 0 ? void 0 : _b.startsWith('https:')) !== null && _c !== void 0 ? _c : false;
5820
+ const result = await openAuthSession(url, opts.redirectUri, { preferUniversalLinks });
5800
5821
  if (!result || result.type === 'cancel' || result.type === 'dismiss') {
5801
5822
  throw new Error('Login cancelled');
5802
5823
  }
5803
5824
  if (result.type !== 'success' || typeof result.url !== 'string') {
5804
- throw new Error(`Hosted login did not complete (result: ${(_b = result === null || result === void 0 ? void 0 : result.type) !== null && _b !== void 0 ? _b : 'unknown'})`);
5825
+ throw new Error(`Hosted login did not complete (result: ${(_d = result === null || result === void 0 ? void 0 : result.type) !== null && _d !== void 0 ? _d : 'unknown'})`);
5805
5826
  }
5806
5827
  const { code, state: returnedState } = parseCallbackParams(result.url);
5807
5828
  if (!code)
@@ -5824,7 +5845,8 @@ async function runNativeLogin(opts) {
5824
5845
  * callback, runs the PKCE exchange INLINE, and resolves with the signed-in User. No
5825
5846
  * completeLoginFromRedirect() call is needed on native. Requires `redirectUri` to be an
5826
5847
  * https UNIVERSAL LINK whose origin the app owner registered in the app's allowedOrigins
5827
- * (custom `myapp://` schemes are rejected by the issuer). Needs the optional peer deps
5848
+ * (custom `myapp://` schemes are rejected by the issuer; an app preview opened in Expo Go
5849
+ * uses `exps://<preview host>/--/<path>`). Needs the optional peer deps
5828
5850
  * expo-web-browser + (expo-crypto or react-native-get-random-values). */
5829
5851
  async function loginWithRedirect(opts) {
5830
5852
  if (isNative())
@@ -6561,7 +6583,7 @@ async function getAuthProvider(config, fromStorage = false) {
6561
6583
  // manager as legacy email sessions. Human login should be started
6562
6584
  // with loginWithRedirect(); this provider is kept as the restore and
6563
6585
  // logout surface for those sessions.
6564
- currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-DyzhiN9Y.js'); })).EmailAuthProvider();
6586
+ currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-IsiArtx0.js'); })).EmailAuthProvider();
6565
6587
  break;
6566
6588
  case "phantom": {
6567
6589
  // First-class Solana WALLET LOGIN (the poof/TaroBase-style "connect
@@ -6603,7 +6625,7 @@ async function getAuthProvider(config, fromStorage = false) {
6603
6625
  // (bounded-login-widget.ts), so registration never counts as
6604
6626
  // evidence the user has a wallet.
6605
6627
  await ensureSolanaMobileWalletRegistered(config, configuredNetwork);
6606
- const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-B8QTPxf6.js'); });
6628
+ const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-CJ0v5Sgn.js'); });
6607
6629
  currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
6608
6630
  break;
6609
6631
  }
@@ -6616,7 +6638,7 @@ async function getAuthProvider(config, fromStorage = false) {
6616
6638
  // Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
6617
6639
  // to point at a specific wallet or set chainId/domain.
6618
6640
  const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
6619
- const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-CKAv4Qxh.js'); });
6641
+ const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider--XJFh-7d.js'); });
6620
6642
  currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
6621
6643
  break;
6622
6644
  }
@@ -6641,7 +6663,7 @@ async function getAuthProvider(config, fromStorage = false) {
6641
6663
  break;
6642
6664
  case "guest":
6643
6665
  // Anonymous auth: a device-local ed25519 keypair signs the challenge.
6644
- currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-Br3iM3O3.js'); })).GuestAuthProvider();
6666
+ currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-DTEwf7qP.js'); })).GuestAuthProvider();
6645
6667
  break;
6646
6668
  }
6647
6669
  if (!currentAuthProvider) {
@@ -6703,7 +6725,7 @@ async function signInAnonymously() {
6703
6725
  // Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
6704
6726
  // the main bundle for data-only apps. Specifier is a static string literal
6705
6727
  // so bundle-splitting can see it.
6706
- const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-Br3iM3O3.js'); })).GuestAuthProvider();
6728
+ const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-DTEwf7qP.js'); })).GuestAuthProvider();
6707
6729
  setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
6708
6730
  // adoptSessionProvider awaits only getConfig() (already resolved here) and then
6709
6731
  // runs every write - provider/method/config/marker/user - in one synchronous
@@ -6874,7 +6896,7 @@ function ensureSharedWalletLoginReady() {
6874
6896
  if (!sharedWalletReady) {
6875
6897
  sharedWalletReady = (async () => {
6876
6898
  await core.getConfig();
6877
- await Promise.resolve().then(function () { return require('./injected-wallet-provider-B8QTPxf6.js'); });
6899
+ await Promise.resolve().then(function () { return require('./injected-wallet-provider-CJ0v5Sgn.js'); });
6878
6900
  })().catch((error) => {
6879
6901
  sharedWalletReady = null;
6880
6902
  throw error;
@@ -6979,7 +7001,7 @@ async function loginWithWallet(options) {
6979
7001
  await ensureSharedWalletLoginReady();
6980
7002
  else
6981
7003
  await ensureWalletLoginReady();
6982
- const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-B8QTPxf6.js'); });
7004
+ const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-CJ0v5Sgn.js'); });
6983
7005
  // Keep the RAW wallet provider: the offchain wrapper forwards only a fixed
6984
7006
  // set of methods, so cleanup below must speak to the provider that actually
6985
7007
  // holds the config rather than to whatever is wrapping it.
@@ -12440,4 +12462,4 @@ exports.useAuth = useAuth;
12440
12462
  exports.useBuildRun = useBuildRun;
12441
12463
  exports.useQuery = useQuery;
12442
12464
  exports.waitForAuthReady = waitForAuthReady;
12443
- //# sourceMappingURL=index-B4_eKphx.js.map
12465
+ //# sourceMappingURL=index-KUBcQdTX.js.map