@bounded-sh/core 0.0.117-sync.0 → 0.0.117

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 (31) hide show
  1. package/dist/client/mirror-sync.d.ts +11 -0
  2. package/dist/client/operations.d.ts +1 -6
  3. package/dist/{index-l5JPD7_a.mjs → index-C6ZW5Gt2.mjs} +11 -78
  4. package/dist/index-C6ZW5Gt2.mjs.map +1 -0
  5. package/dist/{index-BcJOeks0.js → index-DQ0FXeI8.js} +11 -77
  6. package/dist/index-DQ0FXeI8.js.map +1 -0
  7. package/dist/index.js +1 -1
  8. package/dist/index.mjs +1 -1
  9. package/dist/mirror-sync-ChzMq7bH.js +89 -0
  10. package/dist/mirror-sync-ChzMq7bH.js.map +1 -0
  11. package/dist/mirror-sync-kt9PzQen.mjs +86 -0
  12. package/dist/mirror-sync-kt9PzQen.mjs.map +1 -0
  13. package/dist/{realtime-store-5vXHb5Br.js → realtime-store-CURbZ68v.js} +2 -2
  14. package/dist/{realtime-store-5vXHb5Br.js.map → realtime-store-CURbZ68v.js.map} +1 -1
  15. package/dist/{realtime-store-CofPUMMC.mjs → realtime-store-FUjGL_Z8.mjs} +2 -2
  16. package/dist/{realtime-store-CofPUMMC.mjs.map → realtime-store-FUjGL_Z8.mjs.map} +1 -1
  17. package/dist/{solana-message-DXWlEuK5.mjs → solana-message-CEjXjnaG.mjs} +2 -2
  18. package/dist/{solana-message-DXWlEuK5.mjs.map → solana-message-CEjXjnaG.mjs.map} +1 -1
  19. package/dist/{solana-message-CaPunjVI.js → solana-message-F1e5wPKF.js} +2 -2
  20. package/dist/{solana-message-CaPunjVI.js.map → solana-message-F1e5wPKF.js.map} +1 -1
  21. package/dist/{solana-operations-CuWKt_pG.mjs → solana-operations-5WjFwhnt.mjs} +3 -3
  22. package/dist/{solana-operations-CuWKt_pG.mjs.map → solana-operations-5WjFwhnt.mjs.map} +1 -1
  23. package/dist/{solana-operations-BPOTddBI.js → solana-operations-CI0sREvl.js} +3 -3
  24. package/dist/{solana-operations-BPOTddBI.js.map → solana-operations-CI0sREvl.js.map} +1 -1
  25. package/dist/{solana-v1-operations-MbUM3wgC.mjs → solana-v1-operations-DB9pih7o.mjs} +3 -3
  26. package/dist/{solana-v1-operations-MbUM3wgC.mjs.map → solana-v1-operations-DB9pih7o.mjs.map} +1 -1
  27. package/dist/{solana-v1-operations-DTXPM_aZ.js → solana-v1-operations-oot2R63I.js} +3 -3
  28. package/dist/{solana-v1-operations-DTXPM_aZ.js.map → solana-v1-operations-oot2R63I.js.map} +1 -1
  29. package/package.json +1 -1
  30. package/dist/index-BcJOeks0.js.map +0 -1
  31. package/dist/index-l5JPD7_a.mjs.map +0 -1
@@ -0,0 +1,11 @@
1
+ import type { SetOptions } from './operations';
2
+ import type { MirrorSync } from '../types';
3
+ /**
4
+ * Best-effort chain synchronization. A confirmed transaction must NEVER be lost to a
5
+ * synchronization failure, so this reports its outcome in `mirrorSync` and
6
+ * never rejects. The signature lets the server index the exact transaction,
7
+ * including hook-mutated documents beyond the requested destination paths.
8
+ */
9
+ export declare function attemptMirrorSync(paths: string[], options?: SetOptions, transactionSignature?: string): Promise<MirrorSync>;
10
+ /** Refresh concrete paths, or index a confirmed transaction and read its requested paths. */
11
+ export declare function syncItems(paths: string[], options?: SetOptions, transactionSignature?: string): Promise<any>;
@@ -282,12 +282,7 @@ export declare function runExpressionMany(many: {
282
282
  returnType?: 'Bool' | 'String' | 'Int' | 'UInt';
283
283
  _overrides?: RequestOverrides;
284
284
  }[]): Promise<RunExpressionResult[]>;
285
- /**
286
- * Best-effort chain synchronization. A confirmed transaction must NEVER be lost to a
287
- * synchronization failure, so this reports its outcome in `mirrorSync` and
288
- * never rejects. The signature lets the server index the exact transaction,
289
- * including hook-mutated documents beyond the requested destination paths.
290
- */
285
+ /** Best-effort readback, including a failure to load its lazy implementation. */
291
286
  export declare function attemptMirrorSync(paths: string[], options?: SetOptions, transactionSignature?: string): Promise<MirrorSync>;
292
287
  /**
293
288
  * Write a document at `path`. Sugar for a one-element {@link setMany}.
@@ -4305,7 +4305,7 @@ class ServerSessionManager {
4305
4305
  const sessionConfig = (_a = this.sessionConfig) !== null && _a !== void 0 ? _a : undefined;
4306
4306
  /* fetch nonce from auth API (bound to the snapshotted app+issuer) */
4307
4307
  const nonce = await genAuthNonce(sessionConfig);
4308
- const { genSolanaMessage } = await import('./solana-message-DXWlEuK5.mjs');
4308
+ const { genSolanaMessage } = await import('./solana-message-CEjXjnaG.mjs');
4309
4309
  const message = await genSolanaMessage(address, nonce, sessionConfig === null || sessionConfig === void 0 ? void 0 : sessionConfig.appId);
4310
4310
  /* sign the message */
4311
4311
  const sigBytes = nacl.sign.detached(new TextEncoder().encode(message), kp.secretKey);
@@ -7677,7 +7677,7 @@ async function doReconnectWithNewAuth() {
7677
7677
  console.warn('[WS v2] Failed to clear HTTP read cache on auth change:', error);
7678
7678
  }
7679
7679
  try {
7680
- const { reconnectRealtimeStoreWithNewAuth } = await import('./realtime-store-CofPUMMC.mjs');
7680
+ const { reconnectRealtimeStoreWithNewAuth } = await import('./realtime-store-FUjGL_Z8.mjs');
7681
7681
  await reconnectRealtimeStoreWithNewAuth();
7682
7682
  }
7683
7683
  catch (error) {
@@ -8893,64 +8893,11 @@ function buildRequestedDocuments(documents) {
8893
8893
  });
8894
8894
  });
8895
8895
  }
8896
- /** Look a concrete path up in a path-keyed map, tolerating a leading slash. */
8897
- function pickPathDocument(source, path) {
8898
- if (Object.prototype.hasOwnProperty.call(source, path))
8899
- return source[path];
8900
- const withSlash = path.startsWith('/') ? path : `/${path}`;
8901
- if (Object.prototype.hasOwnProperty.call(source, withSlash))
8902
- return source[withSlash];
8903
- const withoutSlash = path.startsWith('/') ? path.slice(1) : path;
8904
- if (Object.prototype.hasOwnProperty.call(source, withoutSlash))
8905
- return source[withoutSlash];
8906
- return undefined;
8907
- }
8908
- /**
8909
- * `observed: true` only when EVERY requested concrete path was read back as a
8910
- * real document. The sync endpoint answers `null` for a document that is
8911
- * absent, lagging, or read-denied, and a deleted path reads back as `null` too
8912
- * — none of those are evidence of synchronization.
8913
- */
8914
- function validatePathKeyedDocuments(paths, source) {
8915
- if (!source || typeof source !== 'object' || Array.isArray(source)) {
8916
- return { observed: false, reason: 'the synchronization response was not a path-keyed document map' };
8917
- }
8918
- const map = source;
8919
- const documents = [];
8920
- const unobserved = [];
8921
- for (const path of paths) {
8922
- const document = pickPathDocument(map, path);
8923
- if (document == null || typeof document !== 'object' || Array.isArray(document)) {
8924
- unobserved.push(path);
8925
- documents.push({ path, document: null });
8926
- continue;
8927
- }
8928
- documents.push({ path, document: document });
8929
- }
8930
- if (unobserved.length > 0) {
8931
- return {
8932
- observed: false,
8933
- reason: `no readable document was returned for ${unobserved.join(', ')} ` +
8934
- '(absent, deleted, lagging, read-denied, or a passthrough write)',
8935
- };
8936
- }
8937
- return { observed: true, documents };
8938
- }
8939
- /**
8940
- * Best-effort chain synchronization. A confirmed transaction must NEVER be lost to a
8941
- * synchronization failure, so this reports its outcome in `mirrorSync` and
8942
- * never rejects. The signature lets the server index the exact transaction,
8943
- * including hook-mutated documents beyond the requested destination paths.
8944
- */
8896
+ /** Best-effort readback, including a failure to load its lazy implementation. */
8945
8897
  async function attemptMirrorSync(paths, options, transactionSignature) {
8946
8898
  try {
8947
- const synced = await syncItems(paths, options, transactionSignature);
8948
- // The sync endpoint answers `{ data: <path-keyed map>, status }`; a document
8949
- // path always contains a `/`, so a top-level `data` key is never one.
8950
- const map = (synced && typeof synced === 'object' && !Array.isArray(synced) && 'data' in synced)
8951
- ? synced.data
8952
- : synced;
8953
- return validatePathKeyedDocuments(paths, map);
8899
+ const mirror = await import('./mirror-sync-kt9PzQen.mjs');
8900
+ return await mirror.attemptMirrorSync(paths, options, transactionSignature);
8954
8901
  }
8955
8902
  catch (error) {
8956
8903
  const message = typeof (error === null || error === void 0 ? void 0 : error.message) === 'string' ? error.message : String(error);
@@ -9169,7 +9116,7 @@ async function setMany(many, options) {
9169
9116
  if (typeof curTx.serializedTransaction !== 'string' || typeof curTx.poofnetIntentId !== 'string') {
9170
9117
  throw new Error('Unsupported 202 transaction shape: a poofnet write needs serializedTransaction and poofnetIntentId');
9171
9118
  }
9172
- const { signPoofnetTransaction, buildExpectedWriteIntent } = await import('./solana-operations-CuWKt_pG.mjs');
9119
+ const { signPoofnetTransaction, buildExpectedWriteIntent } = await import('./solana-operations-5WjFwhnt.mjs');
9173
9120
  const signedTransaction = await signPoofnetTransaction(curTx.serializedTransaction, authProvider, options, buildExpectedWriteIntent(documents));
9174
9121
  // Signing-only, exactly as on a real chain: signed and NOT committed.
9175
9122
  if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
@@ -9207,7 +9154,7 @@ async function setMany(many, options) {
9207
9154
  'Nothing was signed or submitted.');
9208
9155
  }
9209
9156
  const solanaChain = workerChain;
9210
- const { handlePreBuiltTransaction, buildExpectedWriteIntent } = await import('./solana-operations-CuWKt_pG.mjs');
9157
+ const { handlePreBuiltTransaction, buildExpectedWriteIntent } = await import('./solana-operations-5WjFwhnt.mjs');
9211
9158
  // OA-0001: derive the expected intent from OUR OWN request (the one
9212
9159
  // ground truth a tampered builder response cannot change) so the
9213
9160
  // validator can reject any transaction whose operation semantics
@@ -9520,19 +9467,6 @@ async function signAndSubmitTransaction(transaction, feePayer) {
9520
9467
  }
9521
9468
  return config.authProvider.signAndSubmitTransaction(transaction, feePayer);
9522
9469
  }
9523
- /** Refresh concrete paths, or index a confirmed transaction and read its requested paths. */
9524
- async function syncItems(paths, options, transactionSignature) {
9525
- var _a, _b;
9526
- const response = await makeApiRequest('PUT', 'items/sync', Object.assign({ paths }, (transactionSignature !== undefined ? { transactionSignature } : {})), options === null || options === void 0 ? void 0 : options._overrides);
9527
- if (transactionSignature !== undefined && (response.status !== 200
9528
- || ((_a = response.data) === null || _a === void 0 ? void 0 : _a.synchronized) !== true
9529
- || ((_b = response.data) === null || _b === void 0 ? void 0 : _b.transactionSignature) !== transactionSignature)) {
9530
- // An older server's local-read stub can return 200 with stale documents.
9531
- // Only the matching server acknowledgment proves this transaction was indexed.
9532
- throw new Error('the synchronization response did not acknowledge the confirmed transaction');
9533
- }
9534
- return response.data;
9535
- }
9536
9470
 
9537
9471
  var operations = /*#__PURE__*/Object.freeze({
9538
9472
  __proto__: null,
@@ -9557,8 +9491,7 @@ var operations = /*#__PURE__*/Object.freeze({
9557
9491
  setMany: setMany,
9558
9492
  signAndSubmitTransaction: signAndSubmitTransaction,
9559
9493
  signMessage: signMessage,
9560
- signTransaction: signTransaction,
9561
- syncItems: syncItems
9494
+ signTransaction: signTransaction
9562
9495
  });
9563
9496
 
9564
9497
  const DEFAULT_TIMEOUT_MS = 60000;
@@ -11053,7 +10986,7 @@ function toMillis(seconds) {
11053
10986
 
11054
10987
  /** SIWS message creation is async already, so its onchain module can be lazy. */
11055
10988
  async function genSolanaMessage(address, nonce) {
11056
- const implementation = await import('./solana-message-DXWlEuK5.mjs');
10989
+ const implementation = await import('./solana-message-CEjXjnaG.mjs');
11057
10990
  return implementation.genSolanaMessage(address, nonce);
11058
10991
  }
11059
10992
 
@@ -11602,5 +11535,5 @@ function defineLiveModule(mod) {
11602
11535
  return mod;
11603
11536
  }
11604
11537
 
11605
- export { RATE_LIMIT_EVENT_NAME as $, isWriteNotApplied as A, writeNotAppliedPhase as B, subscribe as C, closeAllSubscriptions as D, clearCache as E, getCachedData as F, reconnectWithNewAuth as G, createClient as H, InsufficientBalanceError as I, exchangeAppToken as J, clearAppTokenCache as K, createAppTokenAuthHeaders as L, AppTokenExchangeError as M, setWithVenueGrant as N, resolveVenueRpcUrl as O, subscribeQuery as P, closeAllQuerySubscriptions as Q, canonicalizeArgs as R, ScopedClientReadOnlyError as S, canonicalizeResult as T, DEFAULT_QUERY_POLL_INTERVAL_MS as U, MIN_QUERY_POLL_INTERVAL_MS as V, BoundedDeclineError as W, deriveDecline as X, dispatchDeclineEvent as Y, DECLINE_EVENT_NAME as Z, dispatchRateLimitEvent as _, getWebhookKeysUrl as a, hasActiveConnection as a0, increment as a1, serverTimestamp as a2, now as a3, toSeconds as a4, toMillis as a5, getIdToken as a6, deriveUserIdentityFromIdToken as a7, getSessionGeneration as a8, WebSessionManager as a9, normalizeEvmAddress as aA, toLowerEvmAddress as aB, functions as aC, invoke as aD, FunctionInvokeError as aE, live as aF, intent as aG, status as aH, subscribeView as aI, LiveIntentError as aJ, withEffects as aK, isEffectResult as aL, defineLiveModule as aM, EFFECT_INTENT_ADDRESS as aN, ReactNativeSessionManager as aa, getActiveSessionManager as ab, onSessionCleared as ac, announceSessionChange as ad, onSessionChange as ae, SESSION_SIGNAL_CHANNEL as af, SessionEnvironmentError as ag, UNSUPPORTED_ENVIRONMENT_CODE as ah, AUTH_CHANGED_CODE as ai, AUTH_EXPIRED_CODE as aj, isAuthExpiredError as ak, getFreshAuthToken as al, ServerSessionManager as am, createSessionWithSignature as an, refreshSession as ao, revokeSession as ap, signSessionCreateMessage as aq, genAuthNonce as ar, genSolanaMessage as as, createSolanaSignInRequest as at, createSolanaSignInMessageText as au, genSolanaSignInRequest as av, genSolanaSignInMessage as aw, browserSignInDomain as ax, SOLANA_SIGN_IN_STATEMENT as ay, genSiweMessage as az, bufferExports as b, getConfiguredAppId as c, get as d, getMany as e, docId as f, getConfig as g, setMany as h, init as i, setFile as j, getFiles as k, search as l, markWriteNotApplied as m, runQueryMany as n, runExpression as o, runExpressionMany as p, queryAggregate as q, runQuery as r, set as s, signMessage as t, signTransaction as u, signAndSubmitTransaction as v, count as w, aggregate as x, reconcileSetResult as y, waitForSetResult as z };
11606
- //# sourceMappingURL=index-l5JPD7_a.mjs.map
11538
+ export { dispatchRateLimitEvent as $, waitForSetResult as A, isWriteNotApplied as B, writeNotAppliedPhase as C, subscribe as D, closeAllSubscriptions as E, clearCache as F, getCachedData as G, reconnectWithNewAuth as H, InsufficientBalanceError as I, createClient as J, exchangeAppToken as K, clearAppTokenCache as L, createAppTokenAuthHeaders as M, AppTokenExchangeError as N, setWithVenueGrant as O, resolveVenueRpcUrl as P, subscribeQuery as Q, closeAllQuerySubscriptions as R, ScopedClientReadOnlyError as S, canonicalizeArgs as T, canonicalizeResult as U, DEFAULT_QUERY_POLL_INTERVAL_MS as V, MIN_QUERY_POLL_INTERVAL_MS as W, BoundedDeclineError as X, deriveDecline as Y, dispatchDeclineEvent as Z, DECLINE_EVENT_NAME as _, markWriteNotApplied as a, RATE_LIMIT_EVENT_NAME as a0, hasActiveConnection as a1, increment as a2, serverTimestamp as a3, now as a4, toSeconds as a5, toMillis as a6, getIdToken as a7, deriveUserIdentityFromIdToken as a8, getSessionGeneration as a9, genSiweMessage as aA, normalizeEvmAddress as aB, toLowerEvmAddress as aC, functions as aD, invoke as aE, FunctionInvokeError as aF, live as aG, intent as aH, status as aI, subscribeView as aJ, LiveIntentError as aK, withEffects as aL, isEffectResult as aM, defineLiveModule as aN, EFFECT_INTENT_ADDRESS as aO, WebSessionManager as aa, ReactNativeSessionManager as ab, getActiveSessionManager as ac, onSessionCleared as ad, announceSessionChange as ae, onSessionChange as af, SESSION_SIGNAL_CHANNEL as ag, SessionEnvironmentError as ah, UNSUPPORTED_ENVIRONMENT_CODE as ai, AUTH_CHANGED_CODE as aj, AUTH_EXPIRED_CODE as ak, isAuthExpiredError as al, getFreshAuthToken as am, ServerSessionManager as an, createSessionWithSignature as ao, refreshSession as ap, revokeSession as aq, signSessionCreateMessage as ar, genAuthNonce as as, genSolanaMessage as at, createSolanaSignInRequest as au, createSolanaSignInMessageText as av, genSolanaSignInRequest as aw, genSolanaSignInMessage as ax, browserSignInDomain as ay, SOLANA_SIGN_IN_STATEMENT as az, bufferExports as b, getWebhookKeysUrl as c, getConfiguredAppId as d, get as e, getMany as f, getConfig as g, docId as h, init as i, setMany as j, setFile as k, getFiles as l, makeApiRequest as m, search as n, runQueryMany as o, runExpression as p, queryAggregate as q, runQuery as r, set as s, runExpressionMany as t, signMessage as u, signTransaction as v, signAndSubmitTransaction as w, count as x, aggregate as y, reconcileSetResult as z };
11539
+ //# sourceMappingURL=index-C6ZW5Gt2.mjs.map