@bounded-sh/client 0.0.53-next.1 → 0.0.55

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 (53) hide show
  1. package/README.md +10 -4
  2. package/dist/builds/apps.d.ts +33 -4
  3. package/dist/builds/client.d.ts +5 -1
  4. package/dist/builds/types.d.ts +9 -0
  5. package/dist/{email-auth-provider-CR7B2pob.mjs → email-auth-provider-BKl9GgHV.mjs} +2 -2
  6. package/dist/{email-auth-provider-CRFJd5Rp.mjs.map → email-auth-provider-BKl9GgHV.mjs.map} +1 -1
  7. package/dist/{email-auth-provider-BQ-DTX3z.js → email-auth-provider-BaZceaov.js} +2 -2
  8. package/dist/{email-auth-provider-BQ-DTX3z.js.map → email-auth-provider-BaZceaov.js.map} +1 -1
  9. package/dist/{email-auth-provider-CyEhOnGQ.js → email-auth-provider-lVwM8vRR.js} +2 -2
  10. package/dist/{email-auth-provider-CyEhOnGQ.js.map → email-auth-provider-lVwM8vRR.js.map} +1 -1
  11. package/dist/{email-auth-provider-CRFJd5Rp.mjs → email-auth-provider-yBbGzH2e.mjs} +2 -2
  12. package/dist/{email-auth-provider-CR7B2pob.mjs.map → email-auth-provider-yBbGzH2e.mjs.map} +1 -1
  13. package/dist/{guest-auth-provider-BLzLLs7u.mjs → guest-auth-provider-BnugW3TI.mjs} +2 -2
  14. package/dist/{guest-auth-provider-BLzLLs7u.mjs.map → guest-auth-provider-BnugW3TI.mjs.map} +1 -1
  15. package/dist/{guest-auth-provider-3cWfAi5V.js → guest-auth-provider-DTKczntw.js} +2 -2
  16. package/dist/{guest-auth-provider-3cWfAi5V.js.map → guest-auth-provider-DTKczntw.js.map} +1 -1
  17. package/dist/{guest-auth-provider-1GGM1eWA.mjs → guest-auth-provider-Dgs8zcnC.mjs} +2 -2
  18. package/dist/{guest-auth-provider-1GGM1eWA.mjs.map → guest-auth-provider-Dgs8zcnC.mjs.map} +1 -1
  19. package/dist/{guest-auth-provider-DkUngKob.js → guest-auth-provider-DhN9PoAi.js} +2 -2
  20. package/dist/{guest-auth-provider-DkUngKob.js.map → guest-auth-provider-DhN9PoAi.js.map} +1 -1
  21. package/dist/{index-C6p_-77w.js → index-CXVwyR6_.js} +34 -13
  22. package/dist/{index-C6p_-77w.js.map → index-CXVwyR6_.js.map} +1 -1
  23. package/dist/{index-Co7IqxVo.mjs → index-DkdIADby.mjs} +34 -13
  24. package/dist/{index-Co7IqxVo.mjs.map → index-DkdIADby.mjs.map} +1 -1
  25. package/dist/index.d.ts +2 -0
  26. package/dist/index.js +9 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/index.mjs +2 -2
  29. package/dist/{index.native-BTPOnWux.js → index.native-CouprxZp.js} +34 -13
  30. package/dist/{index.native-BTPOnWux.js.map → index.native-CouprxZp.js.map} +1 -1
  31. package/dist/{index.native-BoKkzObx.mjs → index.native-aSo8M0A8.mjs} +34 -13
  32. package/dist/{index.native-BoKkzObx.mjs.map → index.native-aSo8M0A8.mjs.map} +1 -1
  33. package/dist/index.native.d.ts +2 -0
  34. package/dist/index.native.js +9 -1
  35. package/dist/index.native.js.map +1 -1
  36. package/dist/index.native.mjs +2 -2
  37. package/dist/{injected-evm-wallet-provider-CA9ENSN4.mjs → injected-evm-wallet-provider-BgiFW_kf.mjs} +2 -2
  38. package/dist/{injected-evm-wallet-provider-CA9ENSN4.mjs.map → injected-evm-wallet-provider-BgiFW_kf.mjs.map} +1 -1
  39. package/dist/{injected-evm-wallet-provider-Cjs3K7fU.js → injected-evm-wallet-provider-CiCeS1n2.js} +2 -2
  40. package/dist/{injected-evm-wallet-provider-Cjs3K7fU.js.map → injected-evm-wallet-provider-CiCeS1n2.js.map} +1 -1
  41. package/dist/{injected-evm-wallet-provider-DCqeV702.js → injected-evm-wallet-provider-CtrS-gLC.js} +2 -2
  42. package/dist/{injected-evm-wallet-provider-DCqeV702.js.map → injected-evm-wallet-provider-CtrS-gLC.js.map} +1 -1
  43. package/dist/{injected-evm-wallet-provider-Bsh00akg.mjs → injected-evm-wallet-provider-D7fd42En.mjs} +2 -2
  44. package/dist/{injected-evm-wallet-provider-Bsh00akg.mjs.map → injected-evm-wallet-provider-D7fd42En.mjs.map} +1 -1
  45. package/dist/{injected-wallet-provider-uF4yZt8l.mjs → injected-wallet-provider-BhpwmpgW.mjs} +2 -2
  46. package/dist/{injected-wallet-provider-uF4yZt8l.mjs.map → injected-wallet-provider-BhpwmpgW.mjs.map} +1 -1
  47. package/dist/{injected-wallet-provider-CfzCTdM5.js → injected-wallet-provider-Bic6GpDr.js} +2 -2
  48. package/dist/{injected-wallet-provider-CfzCTdM5.js.map → injected-wallet-provider-Bic6GpDr.js.map} +1 -1
  49. package/dist/{injected-wallet-provider-BwHOxPAR.mjs → injected-wallet-provider-CRG9TaA9.mjs} +2 -2
  50. package/dist/{injected-wallet-provider-BwHOxPAR.mjs.map → injected-wallet-provider-CRG9TaA9.mjs.map} +1 -1
  51. package/dist/{injected-wallet-provider-CmhZtf9E.js → injected-wallet-provider-CST-B9EE.js} +2 -2
  52. package/dist/{injected-wallet-provider-CmhZtf9E.js.map → injected-wallet-provider-CST-B9EE.js.map} +1 -1
  53. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -7,6 +7,8 @@ export type { HostedAuthMethod, OidcLoginOptions, PopupLoginOptions } from "./au
7
7
  export { get, getMany, docId, set, setMany, setFile, getFiles, search, queryAggregate, runQuery, runQueryMany, runExpression, runExpressionMany, signMessage, signTransaction, signAndSubmitTransaction, count, aggregate, GetOptions, SearchOptions, SetOptions, CountOptions, AggregateOptions, AggregateOperation, AggregateResult, AggregateSpec, AggregateRow, QueryAggregateOptions, } from "@bounded-sh/core";
8
8
  export type { GetOptions as BoundedGetOptions } from "@bounded-sh/core";
9
9
  export { subscribe } from "@bounded-sh/core";
10
+ export { createClient, ScopedClientReadOnlyError } from "@bounded-sh/core";
11
+ export type { BoundedClient, CreateClientConfig } from "@bounded-sh/core";
10
12
  export { BoundedDeclineError, deriveDecline, dispatchDeclineEvent, DECLINE_EVENT_NAME } from "@bounded-sh/core";
11
13
  export type { BoundedDecline, DeclineReason, DeclineBoundary } from "@bounded-sh/core";
12
14
  export { dispatchRateLimitEvent, RATE_LIMIT_EVENT_NAME } from "@bounded-sh/core";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-C6p_-77w.js');
3
+ var index = require('./index-CXVwyR6_.js');
4
4
  var core = require('@bounded-sh/core');
5
5
  require('react');
6
6
 
@@ -55,6 +55,10 @@ Object.defineProperty(exports, "RATE_LIMIT_EVENT_NAME", {
55
55
  enumerable: true,
56
56
  get: function () { return core.RATE_LIMIT_EVENT_NAME; }
57
57
  });
58
+ Object.defineProperty(exports, "ScopedClientReadOnlyError", {
59
+ enumerable: true,
60
+ get: function () { return core.ScopedClientReadOnlyError; }
61
+ });
58
62
  Object.defineProperty(exports, "aggregate", {
59
63
  enumerable: true,
60
64
  get: function () { return core.aggregate; }
@@ -63,6 +67,10 @@ Object.defineProperty(exports, "count", {
63
67
  enumerable: true,
64
68
  get: function () { return core.count; }
65
69
  });
70
+ Object.defineProperty(exports, "createClient", {
71
+ enumerable: true,
72
+ get: function () { return core.createClient; }
73
+ });
66
74
  Object.defineProperty(exports, "deriveDecline", {
67
75
  enumerable: true,
68
76
  get: function () { return core.deriveDecline; }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- export { W as BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA, V as BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA, U as BUILD_REVIEW_CAPABILITY_SCHEMA, M as BuildsApiError, S as FAILURE_REASONS, N as NON_TERMINAL_STATES, O as OffchainAuthProvider, Q as PARK_REASONS, P as PrivyExpoProvider, R as RUN_STATES, T as TERMINAL_STATES, G as apps, L as builds, z as completeLoginFromRedirect, B as completeLoginInPopup, k as defaultInjectedEvmProvider, d as defaultInjectedProvider, H as deserializeTransaction, q as getAuthLoading, v as getAuthProvider, m as getCurrentUser, I as getIdToken, g as getPlatform, l as init, t as login, A as loginWithPopup, x as loginWithPrivy, y as loginWithRedirect, u as logout, p as onAuthLoadingChanged, o as onAuthStateChanged, K as requestEip6963Providers, J as setPlatform, w as signInAnonymously, C as useAuth, F as useBuildRun, D as useQuery } from './index-Co7IqxVo.mjs';
1
+ export { W as BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA, V as BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA, U as BUILD_REVIEW_CAPABILITY_SCHEMA, M as BuildsApiError, S as FAILURE_REASONS, N as NON_TERMINAL_STATES, O as OffchainAuthProvider, Q as PARK_REASONS, P as PrivyExpoProvider, R as RUN_STATES, T as TERMINAL_STATES, G as apps, L as builds, z as completeLoginFromRedirect, B as completeLoginInPopup, k as defaultInjectedEvmProvider, d as defaultInjectedProvider, H as deserializeTransaction, q as getAuthLoading, v as getAuthProvider, m as getCurrentUser, I as getIdToken, g as getPlatform, l as init, t as login, A as loginWithPopup, x as loginWithPrivy, y as loginWithRedirect, u as logout, p as onAuthLoadingChanged, o as onAuthStateChanged, K as requestEip6963Providers, J as setPlatform, w as signInAnonymously, C as useAuth, F as useBuildRun, D as useQuery } from './index-DkdIADby.mjs';
2
2
  export * from '@bounded-sh/core';
3
- export { BoundedDeclineError, DECLINE_EVENT_NAME, RATE_LIMIT_EVENT_NAME, aggregate, count, 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';
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';
5
5
  //# sourceMappingURL=index.mjs.map
@@ -4464,7 +4464,7 @@ async function getAuthProvider(config) {
4464
4464
  // manager as legacy email sessions. Human login should be started
4465
4465
  // with loginWithRedirect(); this provider is kept as the restore and
4466
4466
  // logout surface for those sessions.
4467
- currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-CyEhOnGQ.js'); })).EmailAuthProvider();
4467
+ currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-lVwM8vRR.js'); })).EmailAuthProvider();
4468
4468
  break;
4469
4469
  case "wallet":
4470
4470
  case "phantom": {
@@ -4483,7 +4483,7 @@ async function getAuthProvider(config) {
4483
4483
  if (!isWalletLoginEnabled(config)) {
4484
4484
  throw walletLoginNotEnabledError(authMethod);
4485
4485
  }
4486
- const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-CmhZtf9E.js'); });
4486
+ const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-CST-B9EE.js'); });
4487
4487
  currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
4488
4488
  break;
4489
4489
  }
@@ -4496,7 +4496,7 @@ async function getAuthProvider(config) {
4496
4496
  // Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
4497
4497
  // to point at a specific wallet or set chainId/domain.
4498
4498
  const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
4499
- const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-Cjs3K7fU.js'); });
4499
+ const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-CiCeS1n2.js'); });
4500
4500
  currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
4501
4501
  break;
4502
4502
  }
@@ -4524,7 +4524,7 @@ async function getAuthProvider(config) {
4524
4524
  break;
4525
4525
  case "guest":
4526
4526
  // Anonymous auth: a device-local ed25519 keypair signs the challenge.
4527
- currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-DkUngKob.js'); })).GuestAuthProvider();
4527
+ currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-DhN9PoAi.js'); })).GuestAuthProvider();
4528
4528
  break;
4529
4529
  }
4530
4530
  if (!currentAuthProvider) {
@@ -4580,7 +4580,7 @@ async function signInAnonymously() {
4580
4580
  // Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
4581
4581
  // the main bundle for data-only apps. Specifier is a static string literal
4582
4582
  // so bundle-splitting can see it.
4583
- const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-DkUngKob.js'); })).GuestAuthProvider();
4583
+ const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-DhN9PoAi.js'); })).GuestAuthProvider();
4584
4584
  setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
4585
4585
  const commit = (user) => {
4586
4586
  // No await/interleaving inside this block: provider/method/config/marker
@@ -5629,14 +5629,32 @@ const builds = {
5629
5629
  };
5630
5630
 
5631
5631
  async function create(options = {}) {
5632
- const body = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (options.name !== undefined ? { name: options.name } : {})), (options.prompt !== undefined ? { prompt: options.prompt } : {})), (options.clientToken !== undefined ? { clientToken: options.clientToken } : {})), (options.intent !== undefined ? { intent: options.intent } : {})), (options.oapp === true ? { oapp: true } : {}));
5632
+ const body = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (options.name !== undefined ? { name: options.name } : {})), (options.prompt !== undefined ? { prompt: options.prompt } : {})), (options.idempotencyKey !== undefined ? { idempotencyKey: options.idempotencyKey } : {})), (options.intent !== undefined ? { intent: options.intent } : {})), (options.oapp === true ? { oapp: true } : {}));
5633
5633
  const app = await requestDevApi('/apps/new', {
5634
5634
  method: 'POST',
5635
5635
  body,
5636
5636
  });
5637
- return Object.assign(Object.assign({ appId: app.appId }, (typeof app.slug === 'string' && app.slug ? { slug: app.slug } : {})), { url: app.url,
5638
- // Fail closed against an older server response that omitted this field.
5639
- policySeeded: app.policySeeded === true });
5637
+ return Object.assign(Object.assign(Object.assign(Object.assign({ appId: app.appId }, (typeof app.slug === 'string' && app.slug ? { slug: app.slug } : {})), { url: app.url }), (typeof app.prompt === 'string' && app.prompt ? { prompt: app.prompt } : {})), (typeof app.handoff === 'string' && app.handoff ? { handoff: app.handoff } : {}));
5638
+ }
5639
+ /**
5640
+ * F-1200: build the create-flow redirect the owner is sent to after `create()`, with the
5641
+ * prompt and handoff carried in the URL FRAGMENT (never the query - fragments never reach
5642
+ * servers, logs, or Referer). Encoding is byte-exact so the widget's `URLSearchParams`
5643
+ * parse + `.trim()` reproduces the SAME prompt string dev-api hashed into the handoff;
5644
+ * getting this wrong would make the widget reject a genuine token and degrade to prefill.
5645
+ * Callers (bounded.sh, oapps.fun) should use this instead of hand-building the URL.
5646
+ *
5647
+ * Returns `${url}#bounded_prompt=<prompt>` with no `&bounded_handoff=` when the server
5648
+ * minted no handoff (HANDOFF_SECRET unset) - the widget then prefills without auto-running.
5649
+ */
5650
+ function buildCreateRedirectUrl(app) {
5651
+ const base = app.url;
5652
+ const prompt = typeof app.prompt === 'string' ? app.prompt.trim() : '';
5653
+ if (!prompt)
5654
+ return base;
5655
+ const params = `bounded_prompt=${encodeURIComponent(prompt)}`
5656
+ + (app.handoff ? `&bounded_handoff=${encodeURIComponent(app.handoff)}` : '');
5657
+ return `${base}#${params}`;
5640
5658
  }
5641
5659
  async function list() {
5642
5660
  // This legacy-compatible action shape is also used by oapps.fun listMyApps.
@@ -5657,8 +5675,11 @@ async function list() {
5657
5675
  const name = String((_d = row.name) !== null && _d !== void 0 ? _d : '').trim() || '(unnamed app)';
5658
5676
  const slug = typeof row.slug === 'string' && row.slug ? row.slug : undefined;
5659
5677
  const url = typeof row.url === 'string' && row.url.trim() ? row.url.trim() : undefined;
5660
- return Object.assign(Object.assign({ appId,
5661
- name }, (slug ? { slug } : {})), (url ? { url } : {}));
5678
+ const buildStatus = row.buildStatus === 'building' || row.buildStatus === 'build_failed'
5679
+ ? row.buildStatus
5680
+ : undefined;
5681
+ return Object.assign(Object.assign(Object.assign({ appId,
5682
+ name }, (slug ? { slug } : {})), (url ? { url } : {})), (buildStatus ? { buildStatus } : {}));
5662
5683
  })
5663
5684
  .filter((app) => app !== null);
5664
5685
  }
@@ -5666,7 +5687,7 @@ async function list() {
5666
5687
  * Platform first-party surfaces only (bounded.sh, oapps.fun, localhost) —
5667
5688
  * dev-api CORS blocks calls from generated-app origins. Server-side callers unaffected.
5668
5689
  */
5669
- const apps = { create, list };
5690
+ const apps = { create, list, buildCreateRedirectUrl };
5670
5691
 
5671
5692
  async function deserializeTransaction(tx) {
5672
5693
  // Literal specifier so bundlers can code-split the lazy chunk.
@@ -6108,4 +6129,4 @@ exports.setPlatform = setPlatform;
6108
6129
  exports.signInAnonymously = signInAnonymously;
6109
6130
  exports.useAuth = useAuth;
6110
6131
  exports.useBuildRun = useBuildRun;
6111
- //# sourceMappingURL=index.native-BTPOnWux.js.map
6132
+ //# sourceMappingURL=index.native-CouprxZp.js.map