@ultipa-graph/ultipa-driver 6.2.2 → 6.2.4

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, 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, TransactionRow, DBType, InsertType, LabelInfo, NodeTypeInfo, EdgeTypeInfo, ConvPropertyDef, IndexProperty, IndexInfo, FulltextInfo, TaskInfo, ProcessInfo, GraphStats, AlgoInfo, AiReadResult } from './types';
9
+ import { GraphInfo, GraphType, EdgeIdMode, 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;
@@ -72,6 +72,10 @@ export declare class GqldbClient {
72
72
  private storedUsername;
73
73
  private storedPassword;
74
74
  private storedGraph;
75
+ private grpcHost;
76
+ private grpcCredentials;
77
+ private grpcChannelOptions;
78
+ private ctx;
75
79
  private sessionService;
76
80
  private queryService;
77
81
  private graphService;
@@ -95,9 +99,21 @@ export declare class GqldbClient {
95
99
  /** Authenticate the user and create a session */
96
100
  login(username: string, password: string): Promise<Session>;
97
101
  /**
98
- * Execute fn and auto-reconnect on UNAUTHENTICATED error.
99
- * If fn throws an UNAUTHENTICATED gRPC error and credentials are stored,
100
- * re-login and retry fn once.
102
+ * Rebuild every gRPC client used by this connection so the next call
103
+ * gets a fresh channel. Called by withAutoReconnect when a call
104
+ * fails with UNAVAILABLE / connection reset. Does NOT close old
105
+ * clients synchronously — in-flight calls hold them alive and gRPC
106
+ * closes them once those calls complete.
107
+ */
108
+ private forceReconnectAll;
109
+ /**
110
+ * Execute fn with two recovery behaviours:
111
+ * - UNAUTHENTICATED — if stored credentials are available, re-login
112
+ * and retry fn once.
113
+ * - UNAVAILABLE / connection reset — rebuild every gRPC client so
114
+ * the NEXT call gets a fresh channel. The current call is NOT
115
+ * retried; caller decides (write-side calls are often not
116
+ * idempotent).
101
117
  */
102
118
  private withAutoReconnect;
103
119
  /** Terminate the current session */
@@ -112,8 +128,15 @@ export declare class GqldbClient {
112
128
  explain(query: string, config?: QueryConfig): Promise<string>;
113
129
  /** Execute a query with profiling and return statistics */
114
130
  profile(query: string, config?: QueryConfig): Promise<string>;
115
- /** Create a new graph */
116
- createGraph(name: string, graphType?: GraphType, description?: string): Promise<void>;
131
+ /**
132
+ * Create a new graph.
133
+ *
134
+ * When `edgeId` is provided, the driver issues a follow-up
135
+ * `ALTER GRAPH <name> SET EDGE_ID ENABLED|DISABLED` via GQL after the
136
+ * gRPC create call. When `edgeId` is undefined, behavior is unchanged
137
+ * and no ALTER statement is sent.
138
+ */
139
+ createGraph(name: string, graphType?: GraphType, description?: string, edgeId?: EdgeIdMode): Promise<void>;
117
140
  /** Delete a graph */
118
141
  dropGraph(name: string, ifExists?: boolean): Promise<void>;
119
142
  /** Set the current graph for the session */
@@ -308,7 +331,7 @@ export declare class GqldbClient {
308
331
  * Create a graph if it does not already exist.
309
332
  * Returns true if the graph was created, false if it already existed.
310
333
  */
311
- createGraphIfNotExist(name: string, graphType?: GraphType, description?: string): Promise<boolean>;
334
+ createGraphIfNotExist(name: string, graphType?: GraphType, description?: string, edgeId?: EdgeIdMode): Promise<boolean>;
312
335
  /** Check whether a graph with the given name exists */
313
336
  hasGraph(name: string): Promise<boolean>;
314
337
  /** Rename a graph */