@ultipa-graph/ultipa-driver 6.2.1 → 6.2.2

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
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { EventEmitter } from 'events';
5
5
  import { GqldbConfig } from './config';
6
- import { Response, InsertNodesResult, InsertEdgesResult, DeleteResult, ExportNodesResult, ExportEdgesResult, ExportConfig, ExportChunk } from './response';
6
+ import { Response, InsertNodesResult, InsertEdgesResult, ExportNodesResult, ExportEdgesResult, ExportConfig, ExportChunk } from './response';
7
7
  import { Session } from './session';
8
8
  import { Transaction } from './transaction';
9
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';
@@ -25,6 +25,25 @@ export interface InsertConfig extends QueryConfig {
25
25
  /** Insert mode. Defaults to InsertType.Normal when omitted. */
26
26
  insertType?: InsertType;
27
27
  }
28
+ /**
29
+ * Configuration for the new GQL-emitter delete API
30
+ * (deleteNodesByIds / deleteNodesByCondition /
31
+ * deleteEdgesByIds / deleteEdgesByCondition).
32
+ *
33
+ * Extends QueryConfig so per-call `graphName` works the same as
34
+ * `InsertConfig`. Two delete-specific knobs:
35
+ * - `returnDeleted` (default true) — emit `RETURN ...` so the
36
+ * response carries the full deleted node/edge data. Set to false
37
+ * on large bulk deletes to save bandwidth; `rowsAffected` still
38
+ * carries the count.
39
+ * - `allowDeleteAll` (default false) — safety latch. With empty
40
+ * labels/ids AND empty where, the SDK would otherwise emit a
41
+ * graph-wide delete; this flag must be explicitly true to opt in.
42
+ */
43
+ export interface DeleteConfig extends QueryConfig {
44
+ returnDeleted?: boolean;
45
+ allowDeleteAll?: boolean;
46
+ }
28
47
  /** Configuration for insert nodes */
29
48
  export interface InsertNodesConfig {
30
49
  options?: BulkCreateNodesOptions;
@@ -139,10 +158,40 @@ export declare class GqldbClient {
139
158
  insertNodesBatchAuto(graphName: string, nodes: NodeData[], config?: InsertNodesConfig): Promise<InsertNodesResult>;
140
159
  /** Insert multiple edges into a graph using gRPC bulk insert */
141
160
  insertEdgesBatchAuto(graphName: string, edges: EdgeData[], config?: InsertEdgesConfig): Promise<InsertEdgesResult>;
142
- /** Delete nodes from a graph */
143
- deleteNodes(graphName: string, nodeIds?: string[], labels?: string[], where?: string): Promise<DeleteResult>;
144
- /** Delete edges from a graph */
145
- deleteEdges(graphName: string, edgeIds?: string[], label?: string, where?: string): Promise<DeleteResult>;
161
+ /**
162
+ * Delete nodes by id list. Emits
163
+ * `MATCH (n) WHERE id(n) IN [...] DETACH DELETE n RETURN n`.
164
+ *
165
+ * Empty/null `nodeIds` short-circuits without contacting the server.
166
+ *
167
+ * @returns Response with one row per actually-deleted node, column
168
+ * "n" holding the GqldbNode. Use `response.alias("n").asNodes()`.
169
+ * With `returnDeleted=false` the response carries only
170
+ * `rowsAffected`; rows is empty.
171
+ */
172
+ deleteNodesByIds(nodeIds: string[], config?: DeleteConfig): Promise<Response>;
173
+ /**
174
+ * Delete nodes matching labels and/or where clause. Emits
175
+ * `MATCH (n:L1|L2) WHERE <where> DETACH DELETE n RETURN n`.
176
+ *
177
+ * Throws if both labels and where are empty unless
178
+ * `config.allowDeleteAll = true`.
179
+ */
180
+ deleteNodesByCondition(labels: string[] | undefined, where: string | undefined, limit?: number, config?: DeleteConfig): Promise<Response>;
181
+ /**
182
+ * Delete edges by id list. Emits 5-column GQL with `id(e)` so the
183
+ * same emit works on graphs with or without EDGE_ID enabled, then
184
+ * reshapes the response into a single "e" column holding GqldbEdge.
185
+ */
186
+ deleteEdgesByIds(edgeIds: string[], config?: DeleteConfig): Promise<Response>;
187
+ /**
188
+ * Delete edges matching label and/or where. Emits 5-column GQL,
189
+ * then reshapes into a single "e" column.
190
+ *
191
+ * Throws if both label and where are empty unless
192
+ * `config.allowDeleteAll = true`.
193
+ */
194
+ deleteEdgesByCondition(label: string | undefined, where: string | undefined, limit?: number, config?: DeleteConfig): Promise<Response>;
146
195
  /**
147
196
  * Export graph data in JSON Lines format (streaming).
148
197
  * @param config Export configuration