@hakodb/client 0.6.6 → 0.6.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hakodb/client",
3
- "version": "0.6.6",
3
+ "version": "0.6.8",
4
4
  "description": "High-level HakoDB JavaScript/TypeScript client for Node.js and Bun",
5
5
  "repository": {
6
6
  "type": "git",
package/src/client.ts CHANGED
@@ -467,12 +467,35 @@ export class HakoClient {
467
467
  private readonly native: NativeBindings;
468
468
  private readonly engine: unknown;
469
469
  private isClosed = false;
470
+ /** #250: reusable query handles keyed by collection. */
471
+ private readonly queryPool = new Map<string, unknown[]>();
470
472
 
471
473
  private constructor(native: NativeBindings, engine: unknown) {
472
474
  this.native = native;
473
475
  this.engine = engine;
474
476
  }
475
477
 
478
+ /** Acquire a reset handle for `collection`, or create one on first use. */
479
+ acquireQuery(collection: string): unknown {
480
+ const pooled = this.queryPool.get(collection);
481
+ let handle = pooled?.pop();
482
+ if (!handle) {
483
+ handle = this.native.queryNew(collection);
484
+ if (!handle) throw new Error(`queryNew failed: ${this.native.lastError()}`);
485
+ } else {
486
+ ensureOk(this.native.queryReset(handle, collection), this.native, 'queryReset');
487
+ }
488
+ return handle;
489
+ }
490
+
491
+ /** Return a handle to the pool instead of freeing it. */
492
+ releaseQuery(collection: string, handle: unknown): void {
493
+ let pooled = this.queryPool.get(collection);
494
+ if (!pooled) { pooled = []; this.queryPool.set(collection, pooled); }
495
+ if (pooled.length < 32) pooled.push(handle);
496
+ else this.native.queryFree(handle);
497
+ }
498
+
476
499
  static async open(path: string, options?: HakoClientOptions): Promise<HakoClient> {
477
500
  const native = options?.native
478
501
  ?? options?.config?.getNativeBindings()
@@ -1318,8 +1341,7 @@ return this;
1318
1341
 
1319
1342
  private prepareNativeQuery(): unknown {
1320
1343
  const native = this.client.nativeBindings();
1321
- const handle = native.queryNew(this.collection);
1322
- if (!handle) throw new Error(`queryNew failed: ${native.lastError()}`);
1344
+ const handle = this.client.acquireQuery(this.collection);
1323
1345
 
1324
1346
  try {
1325
1347
  for (const filter of this.filters) {
@@ -1427,7 +1449,7 @@ return this;
1427
1449
 
1428
1450
  return handle;
1429
1451
  } catch (err) {
1430
- native.queryFree(handle);
1452
+ this.client.releaseQuery(this.collection, handle);
1431
1453
  throw err;
1432
1454
  }
1433
1455
  }
@@ -1438,7 +1460,7 @@ return this;
1438
1460
  try {
1439
1461
  return parseQueryRows(native.queryExecute(this.client.engineHandle(), handle));
1440
1462
  } finally {
1441
- native.queryFree(handle);
1463
+ this.client.releaseQuery(this.collection, handle);
1442
1464
  }
1443
1465
  }
1444
1466
 
@@ -1452,7 +1474,43 @@ return this;
1452
1474
  try {
1453
1475
  return parseQueryRows(native.queryExecuteJson(this.client.engineHandle(), handle));
1454
1476
  } finally {
1455
- native.queryFree(handle);
1477
+ this.client.releaseQuery(this.collection, handle);
1478
+ }
1479
+ }
1480
+
1481
+ /**
1482
+ * #250: typed rows without JSON materialisation. Uses the view-doc cursor
1483
+ * so each field is pulled by name with its native type. Callers must
1484
+ * know which fields to read (pass `fields`), which is the usual case for
1485
+ * benchmark/UI consumers that only need a few columns.
1486
+ */
1487
+ async getViewRows(fields: string[]): Promise<Array<Record<string, unknown>>> {
1488
+ const native = this.client.nativeBindings();
1489
+ const handle = this.prepareNativeQuery();
1490
+ const rows: Array<Record<string, unknown>> = [];
1491
+ try {
1492
+ native.cursorWalkView(this.client.engineHandle(), handle, (id: string, view: unknown) => {
1493
+ const row: Record<string, unknown> = { id };
1494
+ for (const field of fields) {
1495
+ const has = native.viewHasField(view, field);
1496
+ if (!has) continue;
1497
+ // Type probe via the typed getters; string falls back to getJson-like
1498
+ // path only if no scalar getter has the field.
1499
+ const i = native.viewGetInt(view, field);
1500
+ if (i !== null && i !== undefined) { row[field] = i; continue; }
1501
+ const f = native.viewGetFloat(view, field);
1502
+ if (f !== null && f !== undefined) { row[field] = f; continue; }
1503
+ const b = native.viewGetBool(view, field);
1504
+ if (b !== null && b !== undefined) { row[field] = b; continue; }
1505
+ const str = native.viewGetStr(view, field);
1506
+ if (str !== null && str !== undefined) row[field] = str;
1507
+ }
1508
+ rows.push(row);
1509
+ return true;
1510
+ });
1511
+ return rows;
1512
+ } finally {
1513
+ this.client.releaseQuery(this.collection, handle);
1456
1514
  }
1457
1515
  }
1458
1516
 
@@ -1464,7 +1522,7 @@ return this;
1464
1522
  const json = native.queryExplain(this.client.engineHandle(), handle);
1465
1523
  return json ? (JSON.parse(json) as Record<string, unknown>) : null;
1466
1524
  } finally {
1467
- native.queryFree(handle);
1525
+ this.client.releaseQuery(this.collection, handle);
1468
1526
  }
1469
1527
  }
1470
1528
 
@@ -1481,7 +1539,7 @@ return this;
1481
1539
  if (!rs) throw new Error(`queryExecuteRaw failed: ${native.lastError()}`);
1482
1540
  return new RawQuerySnapshot(this.client, this.collection, rs);
1483
1541
  } finally {
1484
- native.queryFree(handle);
1542
+ this.client.releaseQuery(this.collection, handle);
1485
1543
  }
1486
1544
  }
1487
1545
 
@@ -1493,7 +1551,7 @@ return this;
1493
1551
  if (n < 0) throw new Error(`queryDelete failed: ${native.lastError()}`);
1494
1552
  return n;
1495
1553
  } finally {
1496
- native.queryFree(handle);
1554
+ this.client.releaseQuery(this.collection, handle);
1497
1555
  }
1498
1556
  }
1499
1557
 
@@ -1506,7 +1564,7 @@ return this;
1506
1564
  if (n < 0) throw new Error(`queryDeleteLocal failed: ${native.lastError()}`);
1507
1565
  return n;
1508
1566
  } finally {
1509
- native.queryFree(handle);
1567
+ this.client.releaseQuery(this.collection, handle);
1510
1568
  }
1511
1569
  }
1512
1570
 
@@ -1520,7 +1578,30 @@ return this;
1520
1578
  return n;
1521
1579
  } finally {
1522
1580
  native.docFree(patchDoc);
1523
- native.queryFree(handle);
1581
+ this.client.releaseQuery(this.collection, handle);
1582
+ }
1583
+ }
1584
+
1585
+ /**
1586
+ * #250: run several aggregation ops in ONE FFI round trip. Ops are
1587
+ * `{ count: true }` or `{ sum|avg|min|max: "<field>" }`.
1588
+ * Returns the raw engine map (keys like `count`, `sum_score`).
1589
+ */
1590
+ async aggregate(ops: Array<{ count?: boolean; sum?: string; avg?: string; min?: string; max?: string }>): Promise<Record<string, number>> {
1591
+ const native = this.client.nativeBindings();
1592
+ const handle = this.prepareNativeQuery();
1593
+ try {
1594
+ for (const op of ops) {
1595
+ if (op.count) ensureOk(native.queryAggregateCount(handle), native, 'queryAggregateCount');
1596
+ if (op.sum) ensureOk(native.queryAggregateSum(handle, op.sum), native, 'queryAggregateSum');
1597
+ if (op.avg) ensureOk(native.queryAggregateAvg(handle, op.avg), native, 'queryAggregateAvg');
1598
+ if (op.min) ensureOk(native.queryAggregateMin(handle, op.min), native, 'queryAggregateMin');
1599
+ if (op.max) ensureOk(native.queryAggregateMax(handle, op.max), native, 'queryAggregateMax');
1600
+ }
1601
+ const json = native.queryExecuteAggregation(this.client.engineHandle(), handle);
1602
+ return json ? (JSON.parse(json) as Record<string, number>) : {};
1603
+ } finally {
1604
+ this.client.releaseQuery(this.collection, handle);
1524
1605
  }
1525
1606
  }
1526
1607
 
@@ -1532,7 +1613,7 @@ return this;
1532
1613
  const json = native.queryExecuteAggregation(this.client.engineHandle(), handle);
1533
1614
  return json ? (JSON.parse(json).count || 0) : 0;
1534
1615
  } finally {
1535
- native.queryFree(handle);
1616
+ this.client.releaseQuery(this.collection, handle);
1536
1617
  }
1537
1618
  }
1538
1619
 
@@ -1544,7 +1625,7 @@ return this;
1544
1625
  const json = native.queryExecuteAggregation(this.client.engineHandle(), handle);
1545
1626
  return json ? (JSON.parse(json)[`sum_${field}`] || 0) : 0;
1546
1627
  } finally {
1547
- native.queryFree(handle);
1628
+ this.client.releaseQuery(this.collection, handle);
1548
1629
  }
1549
1630
  }
1550
1631
 
@@ -1556,7 +1637,7 @@ return this;
1556
1637
  const json = native.queryExecuteAggregation(this.client.engineHandle(), handle);
1557
1638
  return json ? (JSON.parse(json)[`avg_${field}`] || 0) : 0;
1558
1639
  } finally {
1559
- native.queryFree(handle);
1640
+ this.client.releaseQuery(this.collection, handle);
1560
1641
  }
1561
1642
  }
1562
1643
 
@@ -1569,7 +1650,7 @@ return this;
1569
1650
  const json = native.queryExecuteAggregation(this.client.engineHandle(), handle);
1570
1651
  return json ? (JSON.parse(json)[`min_${field}`] ?? null) : null;
1571
1652
  } finally {
1572
- native.queryFree(handle);
1653
+ this.client.releaseQuery(this.collection, handle);
1573
1654
  }
1574
1655
  }
1575
1656
 
@@ -1582,7 +1663,7 @@ return this;
1582
1663
  const json = native.queryExecuteAggregation(this.client.engineHandle(), handle);
1583
1664
  return json ? (JSON.parse(json)[`max_${field}`] ?? null) : null;
1584
1665
  } finally {
1585
- native.queryFree(handle);
1666
+ this.client.releaseQuery(this.collection, handle);
1586
1667
  }
1587
1668
  }
1588
1669
 
package/src/native.ts CHANGED
@@ -115,6 +115,8 @@ export interface NativeBindings {
115
115
  queryOffset(query: Handle, offset: number): number;
116
116
  querySelectField(query: Handle, field: string): number;
117
117
  queryExecute(engine: Handle, query: Handle): string | null;
118
+ /** #250: reset a handle in place for reuse (no alloc/free). */
119
+ queryReset(query: Handle, collection: string): number;
118
120
  queryExecuteWithCancel(engine: Handle, query: Handle, cancel: Handle): string | null;
119
121
  cancelNew(): Handle;
120
122
  cancel(cancel: Handle): void;
@@ -217,6 +219,7 @@ export interface NativeBindings {
217
219
  dropTraverseIndex(engine: Handle, collection: string): number;
218
220
  createVectorIndexV2(engine: Handle, collection: string, field: string, dim: number, metric: number, m: number, efConstruction: number, efSearch: number, binaryStage1: number): number;
219
221
  findPathsFull(engine: Handle, collection: string, id: string, direction: number, edge: string | null, via: string | null, maxDepth: number, k: number, includePath: boolean, includeVia: boolean, nodeField: string | null, nodeJSON: string | null, typeField: string | null, typeJSON: string | null, matchField: string | null, matchJSON: string | null): string | null;
222
+ findPathsCount(engine: Handle, collection: string, id: string, direction: number, edge: string | null, maxDepth: number, k: number): bigint;
220
223
  simplePathsFull(engine: Handle, collection: string, id: string, direction: number, edge: string | null, via: string | null, weight: string | null, maxDepth: number, k: number, includePath: boolean, includeVia: boolean, nodeField: string | null, nodeJSON: string | null, typeField: string | null, typeJSON: string | null, matchField: string | null, matchJSON: string | null): string | null;
221
224
  exportGraph(engine: Handle, collection: string, direction: number, edge: string | null, via: string | null, nodeField: string | null, nodeJSON: string | null): string | null;
222
225
  graphAnalysis(engine: Handle, collection: string, op: string, direction: number, edge: string | null, via: string | null, nodeField: string | null, nodeJSON: string | null): string | null;
@@ -452,6 +455,7 @@ async function createBunBindings(libPath: string): Promise<NativeBindings> {
452
455
  hk_engine_find_near_scored_filtered: { args: [FFIType.ptr, FFIType.cstring, FFIType.cstring, FFIType.ptr, FFIType.usize, FFIType.usize, FFIType.f64, FFIType.cstring], returns: FFIType.ptr },
453
456
  hk_engine_subgraph_json_projected: { args: [FFIType.ptr, FFIType.cstring, FFIType.cstring, FFIType.u32, FFIType.u32, FFIType.cstring, FFIType.cstring, FFIType.cstring, FFIType.cstring, FFIType.usize, FFIType.cstring], returns: FFIType.ptr },
454
457
  hk_engine_find_paths_v4: { args: [FFIType.ptr, FFIType.cstring, FFIType.cstring, FFIType.u32, FFIType.cstring, FFIType.cstring, FFIType.usize, FFIType.usize, FFIType.u32, FFIType.u32, FFIType.cstring, FFIType.cstring, FFIType.cstring, FFIType.cstring, FFIType.cstring, FFIType.cstring], returns: FFIType.ptr },
458
+ hk_engine_find_paths_count: { args: [FFIType.ptr, FFIType.cstring, FFIType.cstring, FFIType.u32, FFIType.cstring, FFIType.usize, FFIType.usize], returns: FFIType.i64 },
455
459
  hk_engine_find_simple_paths_v3: { args: [FFIType.ptr, FFIType.cstring, FFIType.cstring, FFIType.u32, FFIType.cstring, FFIType.cstring, FFIType.cstring, FFIType.usize, FFIType.usize, FFIType.u32, FFIType.u32, FFIType.cstring, FFIType.cstring, FFIType.cstring, FFIType.cstring, FFIType.cstring, FFIType.cstring], returns: FFIType.ptr },
456
460
  hk_engine_export_graph: { args: [FFIType.ptr, FFIType.cstring, FFIType.u32, FFIType.cstring, FFIType.cstring, FFIType.cstring, FFIType.cstring], returns: FFIType.ptr },
457
461
  hk_engine_graph_analysis: { args: [FFIType.ptr, FFIType.cstring, FFIType.cstring, FFIType.u32, FFIType.cstring, FFIType.cstring, FFIType.cstring, FFIType.cstring], returns: FFIType.ptr },
@@ -493,6 +497,7 @@ async function createBunBindings(libPath: string): Promise<NativeBindings> {
493
497
  hk_query_offset: { args: [FFIType.ptr, FFIType.usize], returns: FFIType.i32 },
494
498
  hk_query_select_field: { args: [FFIType.ptr, FFIType.cstring], returns: FFIType.i32 },
495
499
  hk_query_execute: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
500
+ hk_query_reset: { args: [FFIType.ptr, FFIType.cstring], returns: FFIType.i32 },
496
501
  hk_query_execute_with_cancel: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
497
502
  hk_cancel_new: { args: [], returns: FFIType.ptr },
498
503
  hk_cancel: { args: [FFIType.ptr], returns: FFIType.void },
@@ -765,6 +770,7 @@ async function createBunBindings(libPath: string): Promise<NativeBindings> {
765
770
  queryOffset: (query, offset) => symbols.hk_query_offset(query, offset),
766
771
  querySelectField: (query, field) => symbols.hk_query_select_field(query, toC(field)),
767
772
  queryExecute: (engine, query) => ptrToStringAndFree(symbols.hk_query_execute(engine, query)),
773
+ queryReset: (query, collection) => symbols.hk_query_reset(query, toC(collection)),
768
774
  queryExecuteWithCancel: (engine, query, cancel) => ptrToStringAndFree(symbols.hk_query_execute_with_cancel(engine, query, cancel)),
769
775
  cancelNew: () => symbols.hk_cancel_new(),
770
776
  cancel: (cancel) => symbols.hk_cancel(cancel),
@@ -850,6 +856,7 @@ async function createBunBindings(libPath: string): Promise<NativeBindings> {
850
856
  dropTraverseIndex: (engine, collection) => symbols.hk_engine_drop_traverse_index(engine, toC(collection)),
851
857
  createVectorIndexV2: (engine, collection, field, dim, metric, m, efConstruction, efSearch, binaryStage1) => symbols.hk_engine_create_vector_index_v2(engine, toC(collection), toC(field), dim, metric, m, efConstruction, efSearch, binaryStage1),
852
858
  findPathsFull: (engine, collection, id, direction, edge, via, maxDepth, k, includePath, includeVia, nodeField, nodeJSON, typeField, typeJSON, matchField, matchJSON) => ptrToStringAndFree(symbols.hk_engine_find_paths_v4(engine, toC(collection), toC(id), direction, edge === null ? null : toC(edge), via === null ? null : toC(via), maxDepth, k, includePath ? 1 : 0, includeVia ? 1 : 0, nodeField === null ? null : toC(nodeField), nodeJSON === null ? null : toC(nodeJSON), typeField === null ? null : toC(typeField), typeJSON === null ? null : toC(typeJSON), matchField === null ? null : toC(matchField), matchJSON === null ? null : toC(matchJSON))),
859
+ findPathsCount: (engine, collection, id, direction, edge, maxDepth, k) => symbols.hk_engine_find_paths_count(engine, toC(collection), toC(id), direction, edge === null ? null : toC(edge), maxDepth, k),
853
860
  simplePathsFull: (engine, collection, id, direction, edge, via, weight, maxDepth, k, includePath, includeVia, nodeField, nodeJSON, typeField, typeJSON, matchField, matchJSON) => ptrToStringAndFree(symbols.hk_engine_find_simple_paths_v3(engine, toC(collection), toC(id), direction, edge === null ? null : toC(edge), via === null ? null : toC(via), weight === null ? null : toC(weight), maxDepth, k, includePath ? 1 : 0, includeVia ? 1 : 0, nodeField === null ? null : toC(nodeField), nodeJSON === null ? null : toC(nodeJSON), typeField === null ? null : toC(typeField), typeJSON === null ? null : toC(typeJSON), matchField === null ? null : toC(matchField), matchJSON === null ? null : toC(matchJSON))),
854
861
  exportGraph: (engine, collection, direction, edge, via, nodeField, nodeJSON) => ptrToStringAndFree(symbols.hk_engine_export_graph(engine, toC(collection), direction, edge === null ? null : toC(edge), via === null ? null : toC(via), nodeField === null ? null : toC(nodeField), nodeJSON === null ? null : toC(nodeJSON))),
855
862
  graphAnalysis: (engine, collection, op, direction, edge, via, nodeField, nodeJSON) => ptrToStringAndFree(symbols.hk_engine_graph_analysis(engine, toC(collection), toC(op), direction, edge === null ? null : toC(edge), via === null ? null : toC(via), nodeField === null ? null : toC(nodeField), nodeJSON === null ? null : toC(nodeJSON))),
@@ -1116,6 +1123,7 @@ async function createNodeBindings(libPath: string): Promise<NativeBindings> {
1116
1123
  hk_engine_find_near_scored_filtered: lib.func('HeapStr hk_engine_find_near_scored_filtered(HK_Engine* engine, const char* collection, const char* field, const float* vec, size_t vec_len, size_t k, double max_distance, const char* filters_json)'),
1117
1124
  hk_engine_subgraph_json_projected: lib.func('HeapStr hk_engine_subgraph_json_projected(HK_Engine* engine, const char* collection, const char* seed_id, uint32_t max_depth, uint32_t direction, const char* edge, const char* via, const char* filter_field, const char* filter_json, size_t node_cap, const char* fields_json)'),
1118
1125
  hk_engine_find_paths_v4: lib.func('HeapStr hk_engine_find_paths_v4(HK_Engine* engine, const char* collection, const char* doc_id, uint32_t direction, const char* edge, const char* via, size_t max_depth, size_t k, uint32_t include_path, uint32_t include_via, const char* filter_field, const char* filter_json, const char* type_field, const char* type_json, const char* match_field, const char* match_json)'),
1126
+ hk_engine_find_paths_count: lib.func('int64_t hk_engine_find_paths_count(HK_Engine* engine, const char* collection, const char* doc_id, uint32_t direction, const char* edge_field, size_t max_depth, size_t k)'),
1119
1127
  hk_engine_find_simple_paths_v3: lib.func('HeapStr hk_engine_find_simple_paths_v3(HK_Engine* engine, const char* collection, const char* doc_id, uint32_t direction, const char* edge, const char* via, const char* weight, size_t max_depth, size_t k, uint32_t include_path, uint32_t include_via, const char* filter_field, const char* filter_json, const char* type_field, const char* type_json, const char* match_field, const char* match_json)'),
1120
1128
  hk_engine_export_graph: lib.func('HeapStr hk_engine_export_graph(HK_Engine* engine, const char* collection, uint32_t direction, const char* edge, const char* via, const char* filter_field, const char* filter_json)'),
1121
1129
  hk_engine_graph_analysis: lib.func('HeapStr hk_engine_graph_analysis(HK_Engine* engine, const char* collection, const char* op, uint32_t direction, const char* edge, const char* via, const char* filter_field, const char* filter_json)'),
@@ -1159,6 +1167,7 @@ async function createNodeBindings(libPath: string): Promise<NativeBindings> {
1159
1167
  hk_query_offset: lib.func('int hk_query_offset(HK_Query* query, size_t offset)'),
1160
1168
  hk_query_select_field: lib.func('int hk_query_select_field(HK_Query* query, const char* field)'),
1161
1169
  hk_query_execute: lib.func('HeapStr hk_query_execute(HK_Engine* engine, const HK_Query* query)'),
1170
+ hk_query_reset: lib.func('int hk_query_reset(HK_Query* query, const char* collection)'),
1162
1171
  hk_query_execute_with_cancel: lib.func('HeapStr hk_query_execute_with_cancel(HK_Engine* engine, const HK_Query* query, HK_Cancel* cancel)'),
1163
1172
  hk_cancel_new: lib.func('HK_Cancel* hk_cancel_new()'),
1164
1173
  hk_cancel: lib.func('void hk_cancel(HK_Cancel* cancel)'),
@@ -1422,6 +1431,7 @@ async function createNodeBindings(libPath: string): Promise<NativeBindings> {
1422
1431
  queryOffset: (query, offset) => fn.hk_query_offset(query, offset),
1423
1432
  querySelectField: (query, field) => fn.hk_query_select_field(query, field),
1424
1433
  queryExecute: (engine, query) => ptrToStringAndFree(fn.hk_query_execute(engine, query)),
1434
+ queryReset: (query, collection) => fn.hk_query_reset(query, collection),
1425
1435
  queryExecuteWithCancel: (engine, query, cancel) => ptrToStringAndFree(fn.hk_query_execute_with_cancel(engine, query, cancel)),
1426
1436
  cancelNew: () => fn.hk_cancel_new(),
1427
1437
  cancel: (cancel) => fn.hk_cancel(cancel),
@@ -1507,6 +1517,7 @@ async function createNodeBindings(libPath: string): Promise<NativeBindings> {
1507
1517
  dropTraverseIndex: (engine, collection) => fn.hk_engine_drop_traverse_index(engine, collection),
1508
1518
  createVectorIndexV2: (engine, collection, field, dim, metric, m, efConstruction, efSearch, binaryStage1) => fn.hk_engine_create_vector_index_v2(engine, collection, field, dim, metric, m, efConstruction, efSearch, binaryStage1),
1509
1519
  findPathsFull: (engine, collection, id, direction, edge, via, maxDepth, k, includePath, includeVia, nodeField, nodeJSON, typeField, typeJSON, matchField, matchJSON) => fn.hk_engine_find_paths_v4(engine, collection, id, direction, edge, via, maxDepth, k, includePath ? 1 : 0, includeVia ? 1 : 0, nodeField, nodeJSON, typeField, typeJSON, matchField, matchJSON),
1520
+ findPathsCount: (engine, collection, id, direction, edge, maxDepth, k) => fn.hk_engine_find_paths_count(engine, collection, id, direction, edge, maxDepth, k),
1510
1521
  simplePathsFull: (engine, collection, id, direction, edge, via, weight, maxDepth, k, includePath, includeVia, nodeField, nodeJSON, typeField, typeJSON, matchField, matchJSON) => fn.hk_engine_find_simple_paths_v3(engine, collection, id, direction, edge, via, weight, maxDepth, k, includePath ? 1 : 0, includeVia ? 1 : 0, nodeField, nodeJSON, typeField, typeJSON, matchField, matchJSON),
1511
1522
  exportGraph: (engine, collection, direction, edge, via, nodeField, nodeJSON) => fn.hk_engine_export_graph(engine, collection, direction, edge, via, nodeField, nodeJSON),
1512
1523
  graphAnalysis: (engine, collection, op, direction, edge, via, nodeField, nodeJSON) => fn.hk_engine_graph_analysis(engine, collection, op, direction, edge, via, nodeField, nodeJSON),