@taladb/node 0.8.2 → 0.8.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/index.d.ts CHANGED
@@ -16,6 +16,36 @@ export declare class TalaDbNode {
16
16
  * every collection returned by `collection()`.
17
17
  */
18
18
  static open(path: string, configJson?: string | undefined | null): TalaDbNode
19
+ /**
20
+ * Compact the underlying storage file, reclaiming space freed by deletes
21
+ * and updates. Call during idle periods after large bulk deletes or
22
+ * tombstone compaction. Returns the number of bytes reclaimed (may be 0).
23
+ */
24
+ compact(): void
25
+ /**
26
+ * Close the database, releasing the file handle and its lock.
27
+ *
28
+ * Subsequent calls on this object return an error. Collections obtained
29
+ * before `close()` keep the underlying storage alive until they are
30
+ * garbage-collected — drop them too to fully release the file.
31
+ */
32
+ close(): void
33
+ /**
34
+ * List user collection names (excludes reserved `_`-prefixed collections
35
+ * such as the sync cursor store). Backs "sync all collections".
36
+ */
37
+ listCollectionNames(): Array<string>
38
+ /**
39
+ * Export changes to `collections` after `sinceMs` (exclusive) as a JSON
40
+ * changeset string, for the bidirectional sync orchestration. `sinceMs`
41
+ * is a millisecond epoch timestamp (the persisted sync cursor).
42
+ */
43
+ exportChanges(sinceMs: number, collections: Array<string>): string
44
+ /**
45
+ * Merge a JSON changeset string (from a remote peer) into the local
46
+ * database via Last-Write-Wins. Returns the number of documents changed.
47
+ */
48
+ importChanges(changesetJson: string): number
19
49
  /**
20
50
  * Get a collection by name. If an HTTP sync hook is configured it is
21
51
  * automatically attached to the returned collection.
@@ -31,6 +61,12 @@ export declare class CollectionNode {
31
61
  find(filter: JsonValue): Array<JsonValue>
32
62
  /** Find a single document or return null. */
33
63
  findOne(filter: JsonValue): JsonValue | null
64
+ /**
65
+ * Run a MongoDB-style aggregation pipeline. `pipeline` is a JSON array of
66
+ * stage objects (`$match`, `$group`, `$sort`, `$skip`, `$limit`,
67
+ * `$project`). Returns the resulting documents.
68
+ */
69
+ aggregate(pipeline: JsonValue): Array<JsonValue>
34
70
  /** Update the first matching document. */
35
71
  updateOne(filter: JsonValue, update: JsonValue): boolean
36
72
  /** Update all matching documents. */
@@ -69,4 +105,36 @@ export declare class CollectionNode {
69
105
  * Returns an array of `{ document: {...}, score: number }` objects.
70
106
  */
71
107
  findNearest(field: string, query: Array<number>, topK: number, filter?: JsonValue | undefined | null): Array<JsonValue>
108
+ /**
109
+ * Zero-copy Float32Array fast path. Avoids the f64→f32 conversion loop
110
+ * used by `findNearest(number[])`, which matters for large embeddings
111
+ * (768/1024/1536 dims) called on the hot path.
112
+ */
113
+ findNearestF32(field: string, query: Float32Array, topK: number, filter?: JsonValue | undefined | null): Array<JsonValue>
114
+ /**
115
+ * Async variant of `findNearest` — runs on the libuv thread pool so large
116
+ * scans or unfiltered HNSW queries don't block the JS thread. Accepts a
117
+ * `Float32Array` for zero-copy embedding transfer.
118
+ */
119
+ findNearestAsync(field: string, query: Float32Array, topK: number, filter?: JsonValue | undefined | null): Promise<Array<any>>
120
+ /**
121
+ * Async variant of `find` — runs on the libuv thread pool so large
122
+ * collection scans don't block the JS thread.
123
+ */
124
+ findAsync(filter: JsonValue): Promise<Array<any>>
125
+ /**
126
+ * Async variant of `insert` — the write (and any HTTP sync hook retries)
127
+ * runs on the libuv thread pool instead of blocking the JS thread.
128
+ */
129
+ insertAsync(doc: JsonValue): Promise<string>
130
+ /** Async variant of `insertMany`. */
131
+ insertManyAsync(docs: Array<JsonValue>): Promise<Array<string>>
132
+ /** Async variant of `updateOne`. */
133
+ updateOneAsync(filter: JsonValue, update: JsonValue): Promise<boolean>
134
+ /** Async variant of `updateMany`. */
135
+ updateManyAsync(filter: JsonValue, update: JsonValue): Promise<number>
136
+ /** Async variant of `deleteOne`. */
137
+ deleteOneAsync(filter: JsonValue): Promise<boolean>
138
+ /** Async variant of `deleteMany`. */
139
+ deleteManyAsync(filter: JsonValue): Promise<number>
72
140
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taladb/node",
3
- "version": "0.8.2",
3
+ "version": "0.8.4",
4
4
  "description": "TalaDB Node.js native module — document queries and vector search via napi-rs",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -25,7 +25,7 @@
25
25
  "repository": {
26
26
  "type": "git",
27
27
  "url": "https://github.com/thinkgrid-labs/taladb.git",
28
- "directory": "packages/taladb-node"
28
+ "directory": "packages/bindings/node"
29
29
  },
30
30
  "homepage": "https://thinkgrid-labs.github.io/taladb/guide/node",
31
31
  "bugs": {
Binary file
Binary file
Binary file