@aouda/client 0.1.14 → 0.1.16

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.
@@ -176,6 +176,38 @@ interface RlsResolversListResponse {
176
176
  resolvers: RlsResolver[];
177
177
  }
178
178
 
179
+ /**
180
+ * Per-database last-observed C-1 consistency token (ADR 0042 D-10, I3).
181
+ * Key comparison is case-insensitive. Implementations must never store a lesser
182
+ * wire string than the one already held (`string` code-unit order, matching
183
+ * `string.CompareOrdinal` on ASCII hex).
184
+ *
185
+ * The default {@link MemoryConsistencyTokenStore} is **insufficient for a
186
+ * horizontally scaled application tier**. Inject a shared store (Redis, cookie
187
+ * round-trip, Aouda table — application-owned). This package does not ship a
188
+ * Redis adapter.
189
+ */
190
+ interface ConsistencyTokenStore {
191
+ get(database: string): string | undefined;
192
+ /**
193
+ * Records `token` for `database` if it is greater than the stored value.
194
+ * Null, empty, or whitespace is a no-op. Equal is a no-op. Does not parse.
195
+ */
196
+ observe(database: string, token: string | null | undefined): void;
197
+ }
198
+ /**
199
+ * In-memory monotone per-database consistency token store.
200
+ * Recreating a client starts a new empty store and silently loses
201
+ * read-your-writes unless the application injects a shared backend.
202
+ */
203
+ declare class MemoryConsistencyTokenStore implements ConsistencyTokenStore {
204
+ private readonly tokens;
205
+ get(database: string): string | undefined;
206
+ observe(database: string, token: string | null | undefined): void;
207
+ }
208
+ declare function compareOrdinal(left: string, right: string): number;
209
+ declare function maxToken(left: string | undefined, right: string | undefined): string | undefined;
210
+
179
211
  /**
180
212
  * @aouda/client type definitions.
181
213
  */
@@ -247,6 +279,12 @@ interface AoudaClientOptions {
247
279
  * Required. Must be a non-empty string (no default).
248
280
  */
249
281
  database: string;
282
+ /**
283
+ * Injectable per-database C-1 token store (ADR 0042 D-10, I3).
284
+ * When omitted, the client owns a new {@link MemoryConsistencyTokenStore}.
285
+ * The in-memory default is insufficient for a horizontally scaled application tier.
286
+ */
287
+ consistencyTokenStore?: ConsistencyTokenStore;
250
288
  /**
251
289
  * Request timeout in milliseconds.
252
290
  * @default 30000
@@ -314,7 +352,7 @@ interface AoudaClientOptions {
314
352
  /** Deprecation (or similar) warning from a named query or named mutation. */
315
353
  interface NamedArtifactWarning {
316
354
  code: string;
317
- hash?: string;
355
+ name?: string;
318
356
  sunsetAt?: string;
319
357
  message: string;
320
358
  }
@@ -409,6 +447,15 @@ interface RequestOptions {
409
447
  /** Sent as X-Request-Id header when provided. */
410
448
  requestId?: string;
411
449
  }
450
+ /**
451
+ * Per-row rejection detail on HTTP `rowErrors` and write-stream `ErrorMessage.errors`.
452
+ * Same three fields as C# `StreamAckRowError`.
453
+ */
454
+ interface StreamAckRowError {
455
+ index: number;
456
+ code: string;
457
+ message: string;
458
+ }
412
459
  /**
413
460
  * User-facing comparison operator for where clauses.
414
461
  * Mapped to wire protocol operators (eq, ne, gt, etc.) internally.
@@ -448,11 +495,13 @@ interface QueryResult<T = Record<string, unknown>> {
448
495
  warnings?: ResultWarning[];
449
496
  /** Total matching rows when the named query declared `count`. */
450
497
  totalMatches?: number;
498
+ /** Observed C-1 consistency token from the envelope. */
499
+ token?: string;
451
500
  }
452
501
  /** Additive result warning from the server. */
453
502
  interface ResultWarning {
454
503
  code: string;
455
- hash?: string;
504
+ name?: string;
456
505
  sunsetAt?: string;
457
506
  }
458
507
  /**
@@ -534,6 +583,8 @@ interface ColumnarResponse {
534
583
  warnings?: ResultWarning[];
535
584
  /** Total matching rows when the named query declared `count`. */
536
585
  totalMatches?: number;
586
+ /** Observed C-1 consistency token from the envelope. */
587
+ token?: string;
537
588
  }
538
589
  /**
539
590
  * Summary of a table returned by list().
@@ -745,6 +796,8 @@ interface InsertResult {
745
796
  executionMs: number;
746
797
  /** Generated values for auto-increment columns. Keys are row indices (as strings). */
747
798
  generatedValues?: Record<string, Record<string, unknown>>;
799
+ /** Observed C-1 consistency token from the envelope. */
800
+ token?: string;
748
801
  }
749
802
  /**
750
803
  * Result of an update or delete operation.
@@ -766,6 +819,8 @@ interface MutationResult {
766
819
  * and the result was truncated to the first 10 000 rows.
767
820
  */
768
821
  rowsTruncated?: boolean;
822
+ /** Observed C-1 consistency token from the envelope. */
823
+ token?: string;
769
824
  }
770
825
  /**
771
826
  * Per-operation result for batch mutations.
@@ -1072,6 +1127,27 @@ interface DatabaseInfo {
1072
1127
  * "application" databases are end-user auth stores browsable via the data explorer.
1073
1128
  */
1074
1129
  authDatabaseKind: "none" | "server" | "application";
1130
+ /**
1131
+ * Non-secret auth linkage. Distinct from `authDatabaseKind`:
1132
+ * `authDatabaseKind` says whether *this* database is an auth store;
1133
+ * `auth.enabled` / `auth.database` say whether this data database is linked to one.
1134
+ * GET/list never include `keys` (`mk_*` is create/regenerate only).
1135
+ * Absent on servers older than this field (treat as unknown, not unlinked).
1136
+ */
1137
+ auth?: DatabaseAuthInfo;
1138
+ }
1139
+ /** App auth keys shown once at create/regenerate. Never re-emitted on GET. */
1140
+ interface DatabaseAuthKeys {
1141
+ anonKey: string;
1142
+ serviceRoleKey: string;
1143
+ publicKey?: string;
1144
+ }
1145
+ /** Non-secret auth linkage on list/get/create. */
1146
+ interface DatabaseAuthInfo {
1147
+ enabled: boolean;
1148
+ database: string | null;
1149
+ /** Present only on create or key regeneration. */
1150
+ keys?: DatabaseAuthKeys;
1075
1151
  }
1076
1152
  /**
1077
1153
  * Options when creating a database (camelCase, matches server request).
@@ -1155,7 +1231,7 @@ interface BulkLoadJobHandle {
1155
1231
  readonly rowsDurablyCommitted: number;
1156
1232
  readonly segmentsCreated: number;
1157
1233
  readonly committedAtUtc: string;
1158
- readonly walPosition: number;
1234
+ readonly token: string;
1159
1235
  readonly writeConcernSatisfied: "acknowledged" | "majority" | "all";
1160
1236
  readonly writeConcernTimedOut: boolean;
1161
1237
  /** True if this load was resumed from a server-restart-recovered job. */
@@ -2468,8 +2544,9 @@ declare class AuthClient {
2468
2544
 
2469
2545
  /**
2470
2546
  * Wire protocol message types for Aouda real-time streaming (ADR 0020 §4).
2471
- * No imports pure type definitions.
2547
+ * Type-only import of StreamAckRowError is allowed; no runtime imports.
2472
2548
  */
2549
+
2473
2550
  type StreamingWireMode = "json" | "msgpack";
2474
2551
  interface AuthMessage {
2475
2552
  type: "auth";
@@ -2489,10 +2566,13 @@ interface SubscribeMessage {
2489
2566
  target?: string;
2490
2567
  filter?: Record<string, unknown>;
2491
2568
  resume_from?: number;
2492
- hash?: string;
2569
+ name?: string;
2493
2570
  args?: Record<string, unknown>;
2494
2571
  conflate?: ConflateOptions;
2495
2572
  orderByIndex?: number;
2573
+ at_least?: string;
2574
+ wait_ms?: number;
2575
+ on_exceeded?: string;
2496
2576
  }
2497
2577
  interface ReAuthMessage {
2498
2578
  type: "re_auth";
@@ -2538,6 +2618,7 @@ interface SnapshotMessage {
2538
2618
  id: string;
2539
2619
  rows: unknown[];
2540
2620
  version: number;
2621
+ token?: string;
2541
2622
  }
2542
2623
  interface SnapshotCompleteMessage {
2543
2624
  type: "snapshot_complete";
@@ -2545,9 +2626,10 @@ interface SnapshotCompleteMessage {
2545
2626
  version: number;
2546
2627
  row_count: number;
2547
2628
  total_matches?: number;
2629
+ token?: string;
2548
2630
  warnings?: Array<{
2549
2631
  code: string;
2550
- hash?: string;
2632
+ name?: string;
2551
2633
  sunsetAt?: string;
2552
2634
  }>;
2553
2635
  }
@@ -2566,6 +2648,7 @@ interface ChangeMessage {
2566
2648
  key?: unknown;
2567
2649
  version: number;
2568
2650
  values_skipped?: number;
2651
+ token?: string;
2569
2652
  }
2570
2653
  interface StreamAckMessage {
2571
2654
  type: "stream_ack";
@@ -2583,12 +2666,14 @@ interface StreamClosedMessage {
2583
2666
  interface HeartbeatMessage {
2584
2667
  type: "heartbeat";
2585
2668
  version: number;
2669
+ token?: string;
2586
2670
  }
2587
2671
  interface ServerErrorMessage {
2588
2672
  type: "error";
2589
2673
  id?: string;
2590
2674
  code: string;
2591
2675
  message: string;
2676
+ errors?: StreamAckRowError[];
2592
2677
  }
2593
2678
  interface PongMessage {
2594
2679
  type: "pong";
@@ -2598,6 +2683,7 @@ type ServerMessage = AuthOkMessage | AuthErrorMessage | SnapshotMessage | Snapsh
2598
2683
  type StreamingMessageHandler = (message: ServerMessage) => void;
2599
2684
  interface StreamingTransport {
2600
2685
  readonly lastVersion: number;
2686
+ readonly lastToken: string | null;
2601
2687
  connect(): Promise<void>;
2602
2688
  send(message: ClientMessage): Promise<void>;
2603
2689
  registerHandler(id: string, handler: StreamingMessageHandler): void;
@@ -2612,6 +2698,7 @@ interface SubscriptionSnapshotEvent<T = Record<string, unknown>> {
2612
2698
  rows: T[];
2613
2699
  version: number;
2614
2700
  totalMatches?: number;
2701
+ token?: string;
2615
2702
  }
2616
2703
  interface SubscriptionChangeEvent<T = Record<string, unknown>> {
2617
2704
  type: "change";
@@ -2621,6 +2708,7 @@ interface SubscriptionChangeEvent<T = Record<string, unknown>> {
2621
2708
  key?: unknown;
2622
2709
  version: number;
2623
2710
  values_skipped?: number;
2711
+ token?: string;
2624
2712
  }
2625
2713
  type SubscriptionEvent<T = Record<string, unknown>> = SubscriptionSnapshotEvent<T> | SubscriptionChangeEvent<T>;
2626
2714
  interface SubscribeOptions<T = Record<string, unknown>> {
@@ -2629,6 +2717,10 @@ interface SubscribeOptions<T = Record<string, unknown>> {
2629
2717
  onError?: (error: Error) => void;
2630
2718
  filter?: Record<string, unknown>;
2631
2719
  conflate?: ConflateOptions;
2720
+ /** Pin snapshot/resume at at least this consistency token. Re-sent on gap/reconnect. */
2721
+ atLeast?: string;
2722
+ waitMs?: number;
2723
+ onExceeded?: string;
2632
2724
  }
2633
2725
  interface Subscription<T = Record<string, unknown>> extends AsyncIterable<SubscriptionEvent<T>> {
2634
2726
  readonly id: string;
@@ -2708,6 +2800,8 @@ interface QueryBuilderState {
2708
2800
  selectExprs: ComputedColumnDef[] | null;
2709
2801
  /** When true, emit `distinct: true` on the wire (SQL SELECT DISTINCT). */
2710
2802
  isDistinct: boolean;
2803
+ /** Pin execute at at least this C-1 token. */
2804
+ atLeast?: string;
2711
2805
  }
2712
2806
  /**
2713
2807
  * Coerces a raw columnar value using the server-declared column type name.
@@ -2758,6 +2852,7 @@ declare class TableQuery<T = Record<string, unknown>> {
2758
2852
  private readonly database;
2759
2853
  private readonly state;
2760
2854
  private readonly getWebSocketTransport;
2855
+ private readonly store;
2761
2856
  /**
2762
2857
  * Creates a new TableQuery instance.
2763
2858
  *
@@ -2767,7 +2862,8 @@ declare class TableQuery<T = Record<string, unknown>> {
2767
2862
  * @param state - Optional initial state (used for immutable chaining).
2768
2863
  * @internal Use `client.table()` to create queries.
2769
2864
  */
2770
- constructor(transport: Transport, tableName: string, database: string, state?: QueryBuilderState, getWebSocketTransport?: () => StreamingTransport);
2865
+ constructor(transport: Transport, tableName: string, database: string, state?: QueryBuilderState, getWebSocketTransport?: () => StreamingTransport, store?: ConsistencyTokenStore);
2866
+ private withState;
2771
2867
  /**
2772
2868
  * Adds a filter predicate to the query.
2773
2869
  * Multiple `where()` calls are combined with AND.
@@ -2877,7 +2973,12 @@ declare class TableQuery<T = Record<string, unknown>> {
2877
2973
  */
2878
2974
  withCrossPartitionAccess(): TableQuery<T>;
2879
2975
  /**
2880
- * Restricts the columns returned in the result.
2976
+ * Pin this query at at least this C-1 token. Observes the token into the
2977
+ * client store (I3, sticky) and presents it on execute via `X-Aouda-Token`.
2978
+ */
2979
+ atLeast(token: string): TableQuery<T>;
2980
+ /**
2981
+ * Selects specific columns to return.
2881
2982
  * If not called, all columns are returned.
2882
2983
  *
2883
2984
  * When T is a specific row type, only keys of T are accepted as column names.
@@ -2913,6 +3014,12 @@ declare class TableQuery<T = Record<string, unknown>> {
2913
3014
  * evaluated per row on the server. Computed columns are appended after any physical-column
2914
3015
  * `select()` projection.
2915
3016
  *
3017
+ * Result types are inferred by the server where the expression permits
3018
+ * (e.g. Int32 → `number`). Uninferable expressions use wire `"Unknown"` /
3019
+ * codegen `unknown`. Computed columns are always nullable. Named-query
3020
+ * `*Row` properties pick this up when regenerated against a post-S08 server.
3021
+ * See aouda-docs/guides/browser-tier-read-limits.md#selectexpr-result-types
3022
+ *
2916
3023
  * @param projections - One or more `{ alias, expr }` pairs.
2917
3024
  * @returns A new TableQuery with computed columns set.
2918
3025
  *
@@ -3376,8 +3483,10 @@ interface SchemaColumnDefinition {
3376
3483
  encoder?: string;
3377
3484
  default?: string;
3378
3485
  description?: string;
3379
- /** Write-time derived expression (stored, not virtual). */
3380
- derived?: ScalarExprNode;
3486
+ /** Write-time derived expression, or `{ identity: "subject" }` (P43 stamp). */
3487
+ derived?: ScalarExprNode | {
3488
+ identity: string;
3489
+ };
3381
3490
  unique?: boolean;
3382
3491
  }
3383
3492
  /** A single insert-time `route` or `tee` transform. */
@@ -3398,6 +3507,8 @@ interface SchemaTableDefinition {
3398
3507
  authMode?: string;
3399
3508
  permissionDimension?: string;
3400
3509
  rlsResolverName?: string;
3510
+ /** jwt-claim PLS source: `subject` or `claim:<name>`. Omit = `claim:tenant_id`. */
3511
+ plsClaimBinding?: string;
3401
3512
  culture?: string;
3402
3513
  checks?: Record<string, WhereClause>;
3403
3514
  transforms?: SchemaTableTransform[];
@@ -3413,8 +3524,8 @@ interface NamedQueryParamConstraint {
3413
3524
  maxItems?: number;
3414
3525
  }
3415
3526
  /**
3416
- * Named-query template in `namedQueries`. Identity is the content hash of the body;
3417
- * export JSON has no `hash` field.
3527
+ * Named-query template in `namedQueries`. Identity is the unique name (the map key).
3528
+ * Export JSON has no hash field; there is no hash identity.
3418
3529
  */
3419
3530
  interface NamedQueryDefinition {
3420
3531
  table: string;
@@ -3484,6 +3595,20 @@ interface SchemaFilterPredicate {
3484
3595
  interface SchemaMaterializedStorage {
3485
3596
  storageTemperature?: string;
3486
3597
  }
3598
+ /**
3599
+ * Closed sortable type set for aggregate MQ computed outputs
3600
+ * (`ComputedOutputValidation.AllowedTypeNames` / JSON-schema `MaterializedComputedOutput`).
3601
+ */
3602
+ type SchemaComputedOutputType = "Int64" | "Double" | "Decimal" | "String" | "Timestamp" | "Date";
3603
+ /**
3604
+ * One computed public column of an aggregate materialized query (ADR 0040 `D-36`).
3605
+ * Wire keys are `outputName` + `type` + `expr` — not query `selectExpr` `{ alias, expr }`.
3606
+ */
3607
+ interface SchemaComputedOutput {
3608
+ outputName: string;
3609
+ type: SchemaComputedOutputType;
3610
+ expr: ScalarExprNode;
3611
+ }
3487
3612
  /**
3488
3613
  * Materialized-query declaration in `materializedQueries`.
3489
3614
  * `groupBy` items are a column-name string or `{ column, function?, outputName? }`.
@@ -3499,6 +3624,16 @@ interface SchemaMaterializedQuery {
3499
3624
  predicate?: SchemaFilterPredicate;
3500
3625
  updateMode?: string;
3501
3626
  storage?: SchemaMaterializedStorage;
3627
+ /**
3628
+ * Direct-client access on the MQ result table. Defaults `false` at apply.
3629
+ * Flipping this is `UpdateDataPlaneAccess`, not a replace.
3630
+ */
3631
+ dataPlaneAccess?: boolean;
3632
+ /**
3633
+ * Write-time public columns on an aggregate MQ. Aggregate-only at apply;
3634
+ * other `type` values with `computed` set are a server `SchemaValidationException`, not a TS error.
3635
+ */
3636
+ computed?: SchemaComputedOutput[];
3502
3637
  }
3503
3638
  /** Root type for `aouda.schema.json`. */
3504
3639
  interface SchemaDocument {
@@ -3508,9 +3643,7 @@ interface SchemaDocument {
3508
3643
  settings?: SchemaSettings;
3509
3644
  extends?: string;
3510
3645
  namedQueries?: Record<string, NamedQueryDefinition>;
3511
- dropNamedQueries?: string[];
3512
3646
  namedMutations?: Record<string, NamedMutationDefinition>;
3513
- dropNamedMutations?: string[];
3514
3647
  materializedQueries?: Record<string, SchemaMaterializedQuery>;
3515
3648
  }
3516
3649
 
@@ -3523,7 +3656,7 @@ interface SchemaDocument {
3523
3656
  * Schema change classification (matches server `SchemaChangeType` enum names).
3524
3657
  * Unknown future values may appear as plain strings at runtime.
3525
3658
  */
3526
- type SchemaChangeType = "CreateTable" | "DropTable" | "AddColumn" | "DropColumn" | "UpdatePolicy" | "UpdateDurability" | "UpdatePartitionLevelSecurity" | "UpdateAuthorizationOptions" | "UpdateTableCulture" | "UpdateSettings" | "UpdateColumnAutoIncrement" | "UpdateColumnType" | "UpdateColumnNullable" | "UpdateColumnEncoder" | "RenameColumn" | "ReorderColumns" | "UpdateColumnReferences" | "UpdateColumnDefault" | "UpdateColumnDescription" | "UpdateTablePrimaryKey" | "UpdateDataPlaneAccess" | "UpdateColumnDerived" | "UpdateColumnUnique" | "UpdateTableChecks" | "UpdateTableTransforms" | "CreateNamedQuery" | "RetargetNamedQueryAlias" | "DeprecateNamedQuery" | "RemoveNamedQuery" | "CreateNamedMutation" | "RetargetNamedMutationAlias" | "DeprecateNamedMutation" | "RemoveNamedMutation" | "CreateMaterializedQuery" | "ReplaceMaterializedQuery" | "DropMaterializedQuery";
3659
+ type SchemaChangeType = "CreateTable" | "DropTable" | "AddColumn" | "DropColumn" | "UpdatePolicy" | "UpdateDurability" | "UpdatePartitionLevelSecurity" | "UpdateAuthorizationOptions" | "UpdateTableCulture" | "UpdateSettings" | "UpdateColumnAutoIncrement" | "UpdateColumnType" | "UpdateColumnNullable" | "UpdateColumnEncoder" | "RenameColumn" | "ReorderColumns" | "UpdateColumnReferences" | "UpdateColumnDefault" | "UpdateColumnDescription" | "UpdateTablePrimaryKey" | "UpdateDataPlaneAccess" | "UpdateColumnDerived" | "UpdateColumnUnique" | "UpdateTableChecks" | "UpdateTableTransforms" | "CreateNamedQuery" | "UpdateNamedQuery" | "UpdateNamedQueryFreshness" | "DeprecateNamedQuery" | "RemoveNamedQuery" | "CreateNamedMutation" | "UpdateNamedMutation" | "DeprecateNamedMutation" | "RemoveNamedMutation" | "CreateMaterializedQuery" | "ReplaceMaterializedQuery" | "DropMaterializedQuery";
3527
3660
  /** Server diff result (matches SchemaDiffResult). */
3528
3661
  interface SchemaDiffResult {
3529
3662
  changes: SchemaChange[];
@@ -3849,13 +3982,16 @@ declare class MaterializedQueriesApi {
3849
3982
  }
3850
3983
 
3851
3984
  /**
3852
- * Hash-only named-query / named-mutation client API (D-5, D-28).
3985
+ * Name-only named-query / named-mutation client API (D-5, D-28).
3986
+ * Identity is the unique schema key, not a content hash or codegen alias.
3853
3987
  */
3854
3988
 
3855
3989
  interface NamedQueryExecuteOptions {
3856
3990
  signal?: AbortSignal;
3857
3991
  /** 0-based index into the definition's `orderByChoices`. Sibling of `args`, not a named-query param. */
3858
3992
  orderByIndex?: number;
3993
+ /** Observe then present this C-1 token on execute. */
3994
+ atLeast?: string;
3859
3995
  }
3860
3996
  interface NamedQuerySubscribeOptions<T = Record<string, unknown>> {
3861
3997
  onSnapshot?: (rows: T[], version: number, totalMatches?: number) => void;
@@ -3864,9 +4000,12 @@ interface NamedQuerySubscribeOptions<T = Record<string, unknown>> {
3864
4000
  conflate?: ConflateOptions;
3865
4001
  /** 0-based index into the definition's `orderByChoices`. */
3866
4002
  orderByIndex?: number;
4003
+ atLeast?: string;
4004
+ waitMs?: number;
4005
+ onExceeded?: string;
3867
4006
  }
3868
4007
  interface NamedQueryBatchItem {
3869
- hash: string;
4008
+ name: string;
3870
4009
  args?: Record<string, unknown>;
3871
4010
  orderByIndex?: number;
3872
4011
  }
@@ -3888,17 +4027,18 @@ declare class NamedQueriesApi {
3888
4027
  private readonly database;
3889
4028
  private readonly onWarning;
3890
4029
  private readonly getStreamingTransport;
3891
- constructor(transport: Transport, database: string, onWarning: NamedArtifactWarningSink, getStreamingTransport: () => StreamingTransport);
3892
- execute<T = Record<string, unknown>>(hash: string, args?: Record<string, unknown>, options?: NamedQueryExecuteOptions): Promise<QueryResult<T>>;
4030
+ private readonly store?;
4031
+ constructor(transport: Transport, database: string, onWarning: NamedArtifactWarningSink, getStreamingTransport: () => StreamingTransport, store?: ConsistencyTokenStore | undefined);
4032
+ execute<T = Record<string, unknown>>(name: string, args?: Record<string, unknown>, options?: NamedQueryExecuteOptions): Promise<QueryResult<T>>;
3893
4033
  batch<T = Record<string, unknown>>(items: NamedQueryBatchItem[], options?: NamedQueryExecuteOptions): Promise<NamedQueryBatchSlotResult<T>[]>;
3894
- subscribe<T = Record<string, unknown>>(hash: string, args?: Record<string, unknown>, options?: NamedQuerySubscribeOptions<T>): Subscription<T>;
4034
+ subscribe<T = Record<string, unknown>>(name: string, args?: Record<string, unknown>, options?: NamedQuerySubscribeOptions<T>): Subscription<T>;
3895
4035
  }
3896
4036
  declare class NamedMutationsApi {
3897
4037
  private readonly transport;
3898
4038
  private readonly database;
3899
4039
  private readonly onWarning;
3900
4040
  constructor(transport: Transport, database: string, onWarning: NamedArtifactWarningSink);
3901
- execute(hash: string, args?: Record<string, unknown>): Promise<NamedMutationResult>;
4041
+ execute(name: string, args?: Record<string, unknown>): Promise<NamedMutationResult>;
3902
4042
  }
3903
4043
 
3904
4044
  /**
@@ -4017,6 +4157,7 @@ declare class AoudaClient<S extends SchemaLike = DefaultSchema> {
4017
4157
  private readonly _streamingEnableLongPollFallback;
4018
4158
  private readonly _streamingLongPollWaitMs;
4019
4159
  private _wsTransport;
4160
+ private readonly _store;
4020
4161
  /**
4021
4162
  * Creates a new AoudaClient instance.
4022
4163
  *
@@ -4118,11 +4259,14 @@ declare class AoudaClient<S extends SchemaLike = DefaultSchema> {
4118
4259
  */
4119
4260
  get materializedQueries(): MaterializedQueriesApi;
4120
4261
  /**
4121
- * Hash-only named-query execute and batch. Names are codegen aliases (D-5).
4262
+ * Named-query execute, read-only batch, and subscribe by unique schema name.
4122
4263
  */
4123
4264
  get namedQueries(): NamedQueriesApi;
4265
+ observeConsistencyToken(token: string | null | undefined): void;
4266
+ getObservedConsistencyToken(): string | undefined;
4267
+ getConsistencyToken(): Promise<string>;
4124
4268
  /**
4125
- * Hash-only named-mutation execute. No batch.
4269
+ * Named-mutation execute by unique schema name. No batch.
4126
4270
  */
4127
4271
  get namedMutations(): NamedMutationsApi;
4128
4272
  /**
@@ -4229,4 +4373,4 @@ declare class AoudaClient<S extends SchemaLike = DefaultSchema> {
4229
4373
  */
4230
4374
  declare function createAoudaClient<S extends SchemaLike = DefaultSchema>(options: AoudaClientOptions): AoudaClient<S>;
4231
4375
 
4232
- export { type BloomFilterMetrics as $, AoudaClient as A, type BulkLoadOptions as B, type CoverageResponse as C, type DetailedHealthResponse as D, type AggregateFunctionName as E, type FailoverClusterResponse as F, type AlterColumnRequest as G, type HealthStatus as H, type AoudaClientOptions as I, type JoinClusterRequest as J, type AoudaDataType as K, type ListBackupsResponse as L, type AppAuthOptions as M, type NodeInfoResponse as N, AuthClient as O, type PromoteClusterResponse as P, type AuthResult as Q, type ReplicationStatusResponse as R, type SchemaLike as S, type Transport as T, type AuthUserInfo as U, type AuthorizationMode as V, BackupAdminApi as W, type BackupMetrics as X, type BackupSummary as Y, type BatchMutationResult as Z, type BatchOperationInput as _, type BulkLoadJobHandle as a, type MetricsSnapshot as a$, type BranchInfo as a0, BranchesApi as a1, type BulkLoadForceAbortRequest as a2, type BulkLoadForceAbortResponse as a3, type BulkLoadListResponse as a4, type BulkLoadProgress as a5, type BulkLoadReplicaProgress as a6, type BulkLoadReplicaProgressDto as a7, type BulkLoadStatusResponse as a8, CircuitBreakerPolicy as a9, HealthAdminApi as aA, type IndexInfo as aB, type InsertOptions as aC, type InsertResult as aD, type IoMetrics as aE, JobsApi as aF, type LatencyPercentiles as aG, MaterializedQueriesApi as aH, type MaterializedQueryDefinition as aI, type MaterializedQueryExecuteOptions as aJ, type MaterializedQueryExecuteResult as aK, type MaterializedQueryMetrics as aL, type MaterializedQueryRefreshOptions as aM, MaterializedQueryState as aN, type MaterializedQueryStateNumber as aO, type MaterializedQueryStatus as aP, MaterializedQueryType as aQ, type MaterializedQueryTypeNumber as aR, type MemberInfo as aS, type MemoryMetrics as aT, type MergeBranchOptions as aU, type MergeConflict as aV, type MergeExecutionResult as aW, type MergeResult as aX, MetricsAdminApi as aY, type MetricsHistory as aZ, type MetricsHistoryOptions as a_, ClusterAdminApi as aa, type ClusterMemberEntry as ab, type ClusterThisNodeEntry as ac, type ColumnSchema as ad, type ColumnSummaryForErd as ae, type ColumnarResponse as af, type ComponentHealthEntry as ag, type ComputedColumnDef as ah, ConfigAdminApi as ai, type CreateBranchRequest as aj, type CreateColumnRequest as ak, type CreateDatabaseOptions as al, type CreatePartitionGrantRequest as am, type CreateRlsResolverRequest as an, type CreateTableRequest as ao, type DatabaseCoverageEntry as ap, type DatabaseInfo as aq, type DatabaseMemoryMetrics as ar, type DatabaseMemoryUsage as as, type DatabaseMetricsDto as at, type DatabaseOptionsInfo as au, DatabasesApi as av, type DeleteOptions as aw, type DiffSummary as ax, FILTER_OPERATORS as ay, type FilterOperator as az, type TopologyResponse as b, type SchemaMaterializedQuery as b$, type MetricsSummary as b0, type MutationResult as b1, type NamedArtifactWarning as b2, type NamedMutationDefinition as b3, type NamedMutationResult as b4, NamedMutationsApi as b5, NamedQueriesApi as b6, type NamedQueryBatchItem as b7, type NamedQueryBatchSlotResult as b8, type NamedQueryDefinition as b9, type QueryMetrics as bA, type QueryResult as bB, type QueryStats as bC, type ReferenceInfo as bD, type RelationshipEndpoint as bE, type RelationshipInfo as bF, type RenameColumnRequest as bG, type RenameTableRequest as bH, type ReorderColumnsRequest as bI, ReplicationAdminApi as bJ, type ReplicationMetrics as bK, type ResidencyConfig as bL, type ResultWarning as bM, RetryPolicy as bN, type RlsResolver as bO, type RlsResolverRule as bP, type RlsResolverRuleInput as bQ, type RlsResolversListResponse as bR, type SchemaAggregateColumn as bS, type SchemaChange as bT, type SchemaChangeType as bU, type SchemaColumnDefinition as bV, type SchemaDiffResult as bW, type SchemaDocument as bX, type SchemaFilterCondition as bY, type SchemaFilterPredicate as bZ, type SchemaGroupByTerm as b_, type NamedQueryExecuteOptions as ba, type NamedQueryParamConstraint as bb, type NamedQuerySubscribeOptions as bc, NodeAdminApi as bd, type NodeLogEntry as be, type NodeLogLevel as bf, type NodeLogStreamOptions as bg, type NodeLogsQuery as bh, type NodeLogsResponse as bi, type OpenWriteStreamOptions as bj, type PageCacheMetrics as bk, type PartitionFunction as bl, type PartitionGrant as bm, type PartitionGrantsListResponse as bn, type PartitioningMetrics as bo, type PendingJobListResponse as bp, type PendingJobResponse as bq, type PerDatabaseLagEntry as br, type PerDatabaseMetrics as bs, type PerDatabaseStatusEntry as bt, PolicyApi as bu, type PolicyInspectRequest as bv, type PolicyInspectResponse as bw, type PolicyInspectTableResult as bx, type PolicyInspectTraverseStart as by, type PolicyInspectVectorProbe as bz, type ReadinessResponse as c, type SchemaMaterializedStorage as c0, type SchemaPartitionKeyEntry as c1, type SchemaRelationshipsResponse as c2, type SchemaSettings as c3, type SchemaSettingsDurability as c4, type SchemaTableDefinition as c5, type SchemaTableDurability as c6, type SchemaTablePolicy as c7, type SchemaTableTransform as c8, type SeedApplyResult as c9, type TestIdentity as cA, type TestIdentityDocument as cB, type TestIdentityGrant as cC, type TimeBucketFunction as cD, type TimeSeriesMetrics as cE, type TransactionMetrics as cF, type TypeGenerationOptions as cG, type UpdateOptions as cH, type UpdateRlsResolverRequest as cI, type UpdateTableOptionsRequest as cJ, type UpdateTablePolicyRequest as cK, type UserProfile as cL, type WalMetrics as cM, WhereGroupBuilder as cN, type WhereOperator as cO, type WriteStream as cP, coerceColumnarValue as cQ, columnarToRows as cR, createAoudaClient as cS, type SeedTableApplyResult as ca, ServerAdminApi as cb, type ServerAuthOptions as cc, type ServerMemoryResponse as cd, type ServerMetricsResponse as ce, type ServiceInfo as cf, type SimdMetrics as cg, type SingleDatabaseMetricsResponse as ch, type SortDirection as ci, type StorageMetrics as cj, type SubscribeOptions as ck, type Subscription as cl, type SubscriptionChangeEvent as cm, type SubscriptionEvent as cn, type SubscriptionInfo as co, type SubscriptionSnapshotEvent as cp, TIME_BUCKET_FUNCTIONS as cq, type TableCoverageEntry as cr, type TableNameFromSchema as cs, type TablePolicy as ct, TableQuery as cu, type TableSchema as cv, type TableSchemaResponse as cw, type TableSummary as cx, type TableSummaryForErd as cy, TablesApi as cz, type TriggerBackupRequest as d, type TriggerBackupResponse as e, type RestoreBackupResponse as f, type BackupSchedule as g, type JoinClusterResponse as h, type LeaveClusterResponse as i, type DrainClusterResponse as j, type ClusterConfigResponse as k, type ClusterConfigPatchRequest as l, type DefaultSchema as m, AGGREGATE_FUNCTIONS as n, AOUDA_DATA_TYPES as o, type AddColumnRequest as p, AdminApi as q, type AdminBackupConfig as r, type AdminBackupPatch as s, type AdminConfigPatchRequest as t, type AdminConfigResponse as u, type AdminConfigSchemaResponse as v, type AdminLoggingConfig as w, type AdminLoggingPatch as x, type AdminMemoryConfig as y, type AdminMemoryPatch as z };
4376
+ export { type BatchOperationInput as $, AoudaClient as A, type BulkLoadOptions as B, type CoverageResponse as C, type DetailedHealthResponse as D, type AdminMemoryPatch as E, type FailoverClusterResponse as F, type AggregateFunctionName as G, type HealthStatus as H, type AlterColumnRequest as I, type JoinClusterRequest as J, type AoudaClientOptions as K, type ListBackupsResponse as L, type AoudaDataType as M, type NodeInfoResponse as N, type AppAuthOptions as O, type PromoteClusterResponse as P, AuthClient as Q, type ReplicationStatusResponse as R, type StreamAckRowError as S, type Transport as T, type AuthResult as U, type AuthUserInfo as V, type AuthorizationMode as W, BackupAdminApi as X, type BackupMetrics as Y, type BackupSummary as Z, type BatchMutationResult as _, type BulkLoadJobHandle as a, type MergeExecutionResult as a$, type BloomFilterMetrics as a0, type BranchInfo as a1, BranchesApi as a2, type BulkLoadForceAbortRequest as a3, type BulkLoadForceAbortResponse as a4, type BulkLoadListResponse as a5, type BulkLoadProgress as a6, type BulkLoadReplicaProgress as a7, type BulkLoadReplicaProgressDto as a8, type BulkLoadStatusResponse as a9, type DeleteOptions as aA, type DiffSummary as aB, FILTER_OPERATORS as aC, type FilterOperator as aD, HealthAdminApi as aE, type IndexInfo as aF, type InsertOptions as aG, type InsertResult as aH, type IoMetrics as aI, JobsApi as aJ, type LatencyPercentiles as aK, MaterializedQueriesApi as aL, type MaterializedQueryDefinition as aM, type MaterializedQueryExecuteOptions as aN, type MaterializedQueryExecuteResult as aO, type MaterializedQueryMetrics as aP, type MaterializedQueryRefreshOptions as aQ, MaterializedQueryState as aR, type MaterializedQueryStateNumber as aS, type MaterializedQueryStatus as aT, MaterializedQueryType as aU, type MaterializedQueryTypeNumber as aV, type MemberInfo as aW, MemoryConsistencyTokenStore as aX, type MemoryMetrics as aY, type MergeBranchOptions as aZ, type MergeConflict as a_, CircuitBreakerPolicy as aa, ClusterAdminApi as ab, type ClusterMemberEntry as ac, type ClusterThisNodeEntry as ad, type ColumnSchema as ae, type ColumnSummaryForErd as af, type ColumnarResponse as ag, type ComponentHealthEntry as ah, type ComputedColumnDef as ai, ConfigAdminApi as aj, type ConsistencyTokenStore as ak, type CreateBranchRequest as al, type CreateColumnRequest as am, type CreateDatabaseOptions as an, type CreatePartitionGrantRequest as ao, type CreateRlsResolverRequest as ap, type CreateTableRequest as aq, type DatabaseAuthInfo as ar, type DatabaseAuthKeys as as, type DatabaseCoverageEntry as at, type DatabaseInfo as au, type DatabaseMemoryMetrics as av, type DatabaseMemoryUsage as aw, type DatabaseMetricsDto as ax, type DatabaseOptionsInfo as ay, DatabasesApi as az, type TopologyResponse as b, type SchemaComputedOutput as b$, type MergeResult as b0, MetricsAdminApi as b1, type MetricsHistory as b2, type MetricsHistoryOptions as b3, type MetricsSnapshot as b4, type MetricsSummary as b5, type MutationResult as b6, type NamedArtifactWarning as b7, type NamedMutationDefinition as b8, type NamedMutationResult as b9, type PolicyInspectRequest as bA, type PolicyInspectResponse as bB, type PolicyInspectTableResult as bC, type PolicyInspectTraverseStart as bD, type PolicyInspectVectorProbe as bE, type QueryMetrics as bF, type QueryResult as bG, type QueryStats as bH, type ReferenceInfo as bI, type RelationshipEndpoint as bJ, type RelationshipInfo as bK, type RenameColumnRequest as bL, type RenameTableRequest as bM, type ReorderColumnsRequest as bN, ReplicationAdminApi as bO, type ReplicationMetrics as bP, type ResidencyConfig as bQ, type ResultWarning as bR, RetryPolicy as bS, type RlsResolver as bT, type RlsResolverRule as bU, type RlsResolverRuleInput as bV, type RlsResolversListResponse as bW, type SchemaAggregateColumn as bX, type SchemaChange as bY, type SchemaChangeType as bZ, type SchemaColumnDefinition as b_, NamedMutationsApi as ba, NamedQueriesApi as bb, type NamedQueryBatchItem as bc, type NamedQueryBatchSlotResult as bd, type NamedQueryDefinition as be, type NamedQueryExecuteOptions as bf, type NamedQueryParamConstraint as bg, type NamedQuerySubscribeOptions as bh, NodeAdminApi as bi, type NodeLogEntry as bj, type NodeLogLevel as bk, type NodeLogStreamOptions as bl, type NodeLogsQuery as bm, type NodeLogsResponse as bn, type OpenWriteStreamOptions as bo, type PageCacheMetrics as bp, type PartitionFunction as bq, type PartitionGrant as br, type PartitionGrantsListResponse as bs, type PartitioningMetrics as bt, type PendingJobListResponse as bu, type PendingJobResponse as bv, type PerDatabaseLagEntry as bw, type PerDatabaseMetrics as bx, type PerDatabaseStatusEntry as by, PolicyApi as bz, type ReadinessResponse as c, maxToken as c$, type SchemaComputedOutputType as c0, type SchemaDiffResult as c1, type SchemaDocument as c2, type SchemaFilterCondition as c3, type SchemaFilterPredicate as c4, type SchemaGroupByTerm as c5, type SchemaMaterializedQuery as c6, type SchemaMaterializedStorage as c7, type SchemaPartitionKeyEntry as c8, type SchemaRelationshipsResponse as c9, type TablePolicy as cA, TableQuery as cB, type TableSchema as cC, type TableSchemaResponse as cD, type TableSummary as cE, type TableSummaryForErd as cF, TablesApi as cG, type TestIdentity as cH, type TestIdentityDocument as cI, type TestIdentityGrant as cJ, type TimeBucketFunction as cK, type TimeSeriesMetrics as cL, type TransactionMetrics as cM, type TypeGenerationOptions as cN, type UpdateOptions as cO, type UpdateRlsResolverRequest as cP, type UpdateTableOptionsRequest as cQ, type UpdateTablePolicyRequest as cR, type UserProfile as cS, type WalMetrics as cT, WhereGroupBuilder as cU, type WhereOperator as cV, type WriteStream as cW, coerceColumnarValue as cX, columnarToRows as cY, compareOrdinal as cZ, createAoudaClient as c_, type SchemaSettings as ca, type SchemaSettingsDurability as cb, type SchemaTableDefinition as cc, type SchemaTableDurability as cd, type SchemaTablePolicy as ce, type SchemaTableTransform as cf, type SeedApplyResult as cg, type SeedTableApplyResult as ch, ServerAdminApi as ci, type ServerAuthOptions as cj, type ServerMemoryResponse as ck, type ServerMetricsResponse as cl, type ServiceInfo as cm, type SimdMetrics as cn, type SingleDatabaseMetricsResponse as co, type SortDirection as cp, type StorageMetrics as cq, type SubscribeOptions as cr, type Subscription as cs, type SubscriptionChangeEvent as ct, type SubscriptionEvent as cu, type SubscriptionInfo as cv, type SubscriptionSnapshotEvent as cw, TIME_BUCKET_FUNCTIONS as cx, type TableCoverageEntry as cy, type TableNameFromSchema as cz, type TriggerBackupRequest as d, type TriggerBackupResponse as e, type RestoreBackupResponse as f, type BackupSchedule as g, type JoinClusterResponse as h, type LeaveClusterResponse as i, type DrainClusterResponse as j, type ClusterConfigResponse as k, type ClusterConfigPatchRequest as l, type SchemaLike as m, type DefaultSchema as n, AGGREGATE_FUNCTIONS as o, AOUDA_DATA_TYPES as p, type AddColumnRequest as q, AdminApi as r, type AdminBackupConfig as s, type AdminBackupPatch as t, type AdminConfigPatchRequest as u, type AdminConfigResponse as v, type AdminConfigSchemaResponse as w, type AdminLoggingConfig as x, type AdminLoggingPatch as y, type AdminMemoryConfig as z };