@taladb/node 0.8.3 → 0.9.0

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
@@ -15,7 +15,7 @@ export declare class TalaDbNode {
15
15
  * `sync-http` feature is compiled in, an `HttpSyncHook` is attached to
16
16
  * every collection returned by `collection()`.
17
17
  */
18
- static open(path: string, configJson?: string | undefined | null): TalaDbNode
18
+ static open(path: string, configJson?: string | undefined | null, passphrase?: string | undefined | null): TalaDbNode
19
19
  /**
20
20
  * Compact the underlying storage file, reclaiming space freed by deletes
21
21
  * and updates. Call during idle periods after large bulk deletes or
@@ -30,6 +30,22 @@ export declare class TalaDbNode {
30
30
  * garbage-collected — drop them too to fully release the file.
31
31
  */
32
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
33
49
  /**
34
50
  * Get a collection by name. If an HTTP sync hook is configured it is
35
51
  * automatically attached to the returned collection.
@@ -45,6 +61,12 @@ export declare class CollectionNode {
45
61
  find(filter: JsonValue): Array<JsonValue>
46
62
  /** Find a single document or return null. */
47
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>
48
70
  /** Update the first matching document. */
49
71
  updateOne(filter: JsonValue, update: JsonValue): boolean
50
72
  /** Update all matching documents. */
@@ -59,6 +81,10 @@ export declare class CollectionNode {
59
81
  createIndex(field: string): void
60
82
  /** Drop a secondary index. */
61
83
  dropIndex(field: string): void
84
+ /** Create a compound (multi-field) index over an ordered list of fields. */
85
+ createCompoundIndex(fields: Array<string>): void
86
+ /** Drop a compound index by its ordered field list. */
87
+ dropCompoundIndex(fields: Array<string>): void
62
88
  /**
63
89
  * Create a vector index on `field`.
64
90
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taladb/node",
3
- "version": "0.8.3",
3
+ "version": "0.9.0",
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": {
@@ -46,6 +46,6 @@
46
46
  "scripts": {
47
47
  "build": "napi build --platform --release --js index.js --dts index.d.ts",
48
48
  "build:debug": "napi build --platform --js index.js --dts index.d.ts",
49
- "test": "jest"
49
+ "test": "jest --passWithNoTests"
50
50
  }
51
51
  }
Binary file
Binary file
Binary file