@ultipa-graph/ultipa-driver 6.0.14 → 6.0.15

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.
package/dist/client.d.ts CHANGED
@@ -6,7 +6,7 @@ import { GqldbConfig } from './config';
6
6
  import { Response, InsertNodesResult, InsertEdgesResult, DeleteResult, ExportNodesResult, ExportEdgesResult, ExportConfig, ExportChunk } from './response';
7
7
  import { Session } from './session';
8
8
  import { Transaction } from './transaction';
9
- import { GraphInfo, GraphType, HealthStatus, CacheStats, CacheType, Statistics, CompactResult, ComputeTopologyResult, SystemMetrics, NodeData, EdgeData, BulkCreateNodesOptions, BulkCreateEdgesOptions, BulkImportOptions, BulkImportSession, CheckpointResult, EndBulkImportResult, AbortBulkImportResult, BulkImportStatus, TransactionInfo, DBType, InsertType, LabelInfo, NodeTypeInfo, EdgeTypeInfo, ConvPropertyDef, IndexProperty, IndexInfo, FulltextInfo, TaskInfo, ProcessInfo, GraphStats, AlgoInfo, AiReadResult } from './types';
9
+ import { GraphInfo, GraphType, HealthStatus, CacheStats, CacheType, Statistics, CompactResult, ComputeTopologyResult, SystemMetrics, NodeData, EdgeData, BulkCreateNodesOptions, BulkCreateEdgesOptions, BulkImportOptions, BulkImportSession, CheckpointResult, EndBulkImportResult, AbortBulkImportResult, BulkImportStatus, TransactionInfo, TransactionRow, DBType, InsertType, LabelInfo, NodeTypeInfo, EdgeTypeInfo, ConvPropertyDef, IndexProperty, IndexInfo, FulltextInfo, TaskInfo, ProcessInfo, GraphStats, AlgoInfo, AiReadResult } from './types';
10
10
  /** Configuration for a query */
11
11
  export interface QueryConfig {
12
12
  graphName?: string;
@@ -63,6 +63,13 @@ export declare class GqldbClient {
63
63
  private bulkImportService;
64
64
  /** Get session metadata for authenticated requests */
65
65
  private getSessionMetadata;
66
+ /**
67
+ * Stable per-client logical session id surfaced under the
68
+ * transaction-branch model. See TRANSACTIONS_DRIVER_GUIDE.md §2.0–2.1.
69
+ * Falls back to a UUID v4 hex generated at construction when
70
+ * `config.sessionId` is not set.
71
+ */
72
+ readonly clientSessionId: string;
66
73
  constructor(config: GqldbConfig);
67
74
  /** Close the client and all connections */
68
75
  close(): Promise<void>;
@@ -106,6 +113,28 @@ export declare class GqldbClient {
106
113
  listTransactions(): Promise<TransactionInfo[]>;
107
114
  /** Execute a function within a transaction */
108
115
  withTransaction<T>(graphName: string, fn: (txId: number) => Promise<T>, readOnly?: boolean): Promise<T>;
116
+ /**
117
+ * Return active transactions via the GQL admin DDL `SHOW TRANSACTIONS`.
118
+ * Each row mirrors the 5-column server-side schema:
119
+ * `transactionId / status / readOnly / startTime / sessionId`.
120
+ * `sessionId` is `''` unless the server has auto-derived one from peer
121
+ * info or the driver explicitly surfaces `x-ultipa-session-id` metadata.
122
+ *
123
+ * Distinct from `listTransactions()` which uses the legacy gRPC.
124
+ */
125
+ showTransactions(): Promise<TransactionRow[]>;
126
+ /**
127
+ * Roll back a single transaction by id via `KILL TRANSACTION '<id>'`.
128
+ * `transactionId` here is the **string** id surfaced by
129
+ * `showTransactions()` (e.g. `'tx_a396c531-...'`), distinct from the
130
+ * `number` id returned by `begin()`.
131
+ */
132
+ killTransaction(transactionId: string): Promise<Response>;
133
+ /**
134
+ * Roll back every active transaction via `RESET TRANSACTIONS`. Admin-only.
135
+ * Intended as an escape hatch when an orphan tx blocks new BEGINs.
136
+ */
137
+ resetTransactions(): Promise<Response>;
109
138
  /** Insert multiple nodes into a graph using gRPC bulk insert */
110
139
  insertNodesBatchAuto(graphName: string, nodes: NodeData[], config?: InsertNodesConfig): Promise<InsertNodesResult>;
111
140
  /** Insert multiple edges into a graph using gRPC bulk insert */