@taladb/node 0.9.1 → 0.9.3

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,11 @@ export declare class TalaDbNode {
16
16
  * every collection returned by `collection()`.
17
17
  */
18
18
  static open(path: string, configJson?: string | undefined | null, passphrase?: string | undefined | null): TalaDbNode
19
+ /**
20
+ * Force any batched (eventual-durability) writes to disk. No-op under the
21
+ * default immediate durability. Backs `db.flush()`.
22
+ */
23
+ flush(): void
19
24
  /**
20
25
  * Compact the underlying storage file, reclaiming space freed by deletes
21
26
  * and updates. Call during idle periods after large bulk deletes or
@@ -46,6 +51,31 @@ export declare class TalaDbNode {
46
51
  * database via Last-Write-Wins. Returns the number of documents changed.
47
52
  */
48
53
  importChanges(changesetJson: string): number
54
+ /**
55
+ * Merge a JSON changeset through a tolerant structural validator built from
56
+ * `schemas_json` — a `{ "<collection>": { version, required, types,
57
+ * defaults } }` object. Every imported upsert is normalized, skipped, or
58
+ * quarantined per its collection schema before Last-Write-Wins; a rejected
59
+ * document is set aside (see `quarantined`), never dropped, and never
60
+ * aborts the batch. Returns `{ applied, skipped, quarantined }`.
61
+ */
62
+ importChangesValidated(changesetJson: string, schemasJson: string): JsonValue
63
+ /**
64
+ * Return every document currently held in `collection`'s quarantine table,
65
+ * each as `{ document, reason, changedAt }`. Empty when nothing has been
66
+ * set aside. For operator inspection and recovery tooling.
67
+ */
68
+ quarantined(collection: string): Array<JsonValue>
69
+ /**
70
+ * Read the current application migration version (0 if never set). Backs
71
+ * the `openDB({ migrations })` runner, which advances it per migration.
72
+ */
73
+ userVersion(): number
74
+ /**
75
+ * Persist the application migration version. Called after each migration's
76
+ * body succeeds so a crash mid-run resumes from the last applied version.
77
+ */
78
+ setUserVersion(version: number): void
49
79
  /**
50
80
  * Get a collection by name. If an HTTP sync hook is configured it is
51
81
  * automatically attached to the returned collection.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taladb/node",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
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",
Binary file
Binary file
Binary file