@bounded-sh/server 0.0.64 → 0.0.66

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.
@@ -1,10 +1,18 @@
1
1
  import { Transaction, VersionedTransaction, PublicKey } from '@solana/web3.js';
2
2
  import { ServerSessionManager } from '@bounded-sh/core';
3
- import type { AuthProvider, SetOptions, GetOptions, SearchOptions, GetManyResult, RunQueryOptions, RunExpressionOptions, RunExpressionResult, CountOptions, AggregateOptions, AggregateOperation, AggregateResult, AggregateSpec, AggregateRow, QueryAggregateOptions, RequestOverrides, EvmTransactionPolicy, SubscriptionOptions, InvokeOptions, LiveIntentOptions, LiveStatus, LiveStatusOptions } from '@bounded-sh/core';
3
+ import type { ClientConfig, AuthProvider, SetOptions, GetOptions, SearchOptions, GetManyResult, RunQueryOptions, RunExpressionOptions, RunExpressionResult, CountOptions, AggregateOptions, AggregateOperation, AggregateResult, AggregateSpec, AggregateRow, QueryAggregateOptions, RequestOverrides, EvmTransactionPolicy, SubscriptionOptions, InvokeOptions, LiveIntentOptions, LiveStatus, LiveStatusOptions, SetResult, FileUploadResult, FileDeleteResult, ReconcileSetResultOptions, WaitForSetResultOptions } from '@bounded-sh/core';
4
4
  export declare class WalletClient {
5
5
  private readonly provider;
6
6
  private readonly sessionManager;
7
7
  readonly address: string;
8
+ /**
9
+ * Immutable snapshot of the resolved Bounded config this wallet client was
10
+ * created against. It is threaded (as `_config`) into every data/file/query/
11
+ * aggregate/function/live/websocket request so the client's app + endpoint
12
+ * targets can never follow a later global `init(...)` (CTA-05). Without it,
13
+ * core would resolve app/endpoints from the mutable process-global config.
14
+ */
15
+ private readonly config;
8
16
  private readonly evmTransactionPolicy?;
9
17
  readonly live: {
10
18
  intent: (roomPath: string, intent: unknown, opts?: LiveIntentOptions) => Promise<{
@@ -17,7 +25,7 @@ export declare class WalletClient {
17
25
  onError?: (error: any) => void;
18
26
  }) => Promise<() => Promise<void>>;
19
27
  };
20
- constructor(provider: AuthProvider, sessionManager: ServerSessionManager, address: string, evmTransactionPolicy?: EvmTransactionPolicy);
28
+ constructor(provider: AuthProvider, sessionManager: ServerSessionManager, address: string, config: ClientConfig, evmTransactionPolicy?: EvmTransactionPolicy);
21
29
  private buildOverrides;
22
30
  /** #023: strip caller Authorization (any casing) so operations run as the isolated wallet. */
23
31
  private sanitizeHeaders;
@@ -25,14 +33,24 @@ export declare class WalletClient {
25
33
  private mergeReadOverrides;
26
34
  private mergeLiveIntentOptions;
27
35
  private mergeLiveStatusOptions;
28
- set(path: string, document: any, options?: SetOptions): Promise<any>;
36
+ set(path: string, document: any, options?: SetOptions): Promise<SetResult>;
29
37
  setMany(many: {
30
38
  path: string;
31
39
  document: any;
32
- }[], options?: SetOptions): Promise<any>;
40
+ }[], options?: SetOptions): Promise<SetResult>;
33
41
  setFile(path: string, file: File | null, options?: {
34
42
  _overrides?: RequestOverrides;
35
- }): Promise<any>;
43
+ }): Promise<FileUploadResult | FileDeleteResult>;
44
+ /**
45
+ * Reconcile a `submitted` write receipt through THIS client's own provider
46
+ * and app binding. A bare top-level `reconcileSetResult` cannot serve a wallet
47
+ * client: the provider and config are private to the instance, and a later
48
+ * global `init()` would otherwise reconcile against the wrong app.
49
+ */
50
+ reconcileSetResult(receipt: SetResult, options?: ReconcileSetResultOptions): Promise<SetResult>;
51
+ /** Bounded repeat of {@link reconcileSetResult}; see `waitForSetResult`. */
52
+ waitForSetResult(receipt: SetResult, options?: WaitForSetResultOptions): Promise<SetResult>;
53
+ private mergeReconcileOptions;
36
54
  get(path: string, opts?: GetOptions): Promise<any>;
37
55
  getMany(paths: string[], opts?: {
38
56
  bypassCache?: boolean;
@@ -9,6 +9,13 @@ export interface WebhookPayload {
9
9
  document: Record<string, any> | null;
10
10
  previousDocument: Record<string, any> | null;
11
11
  timestamp: number;
12
+ /**
13
+ * SHW-05: stable per-delivery id (also in the `X-Bounded-Delivery-Id` header),
14
+ * REUSED across every retry of one delivery. Delivery is durable + at-least-
15
+ * once, so dedupe on THIS - not the timestamp or signature, which change per
16
+ * retry. Optional so a payload signed before the field existed still verifies.
17
+ */
18
+ deliveryId?: string;
12
19
  }
13
20
  export interface WebhookPublicKey {
14
21
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bounded-sh/server",
3
- "version": "0.0.64",
3
+ "version": "0.0.66",
4
4
  "description": "Node and server SDK for Bounded, the full-stack app builder and runtime for AI-built apps: keypair-authenticated data, files and search, functions, realtime, webhook verification, and atomic writes.",
5
5
  "homepage": "https://bounded.sh/docs/sdk",
6
6
  "main": "./dist/index.js",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "scripts": {
17
17
  "build": "rm -rf ./dist ./.rollup-tmp && tsc -p tsconfig.build.json --outDir .rollup-tmp --declarationDir .rollup-tmp --emitDeclarationOnly false && rollup -c && tsc -p tsconfig.build.json --emitDeclarationOnly --declarationDir dist && rm -rf ./.rollup-tmp",
18
- "test": "node src/auth/providers/run-solana-keypair-blockhash-test.mjs && node src/auth/providers/evm-keypair-provider.source.test.mjs && node src/run-server-global-provider-test.mjs && node --test src/webhooks.test.mjs",
18
+ "test": "node src/auth/providers/run-solana-keypair-blockhash-test.mjs && node src/auth/providers/evm-keypair-provider.source.test.mjs && node src/run-server-global-provider-test.mjs && node src/wallet-client-config-binding.source.test.mjs && node --test src/webhooks.test.mjs && node --test src/package-lock-core-pin.test.mjs",
19
19
  "watch": "rollup -c -w",
20
20
  "prepare": "npm run build"
21
21
  },
@@ -51,7 +51,7 @@
51
51
  "typescript": "5.9.3"
52
52
  },
53
53
  "dependencies": {
54
- "@bounded-sh/core": "0.0.64",
54
+ "@bounded-sh/core": "0.0.66",
55
55
  "@coral-xyz/anchor": "0.31.1",
56
56
  "@solana/web3.js": "1.98.4",
57
57
  "axios": "1.18.1",