@lpdjs/firestore-repo-service 3.0.19 → 3.0.20

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.
Files changed (39) hide show
  1. package/dist/{create-servers-bMJVVjPj.d.ts → create-servers-BX4FC03_.d.ts} +3 -3
  2. package/dist/{create-servers-DydjOOOS.d.cts → create-servers-DSxgSZ2p.d.cts} +3 -3
  3. package/dist/{effects-DcM19dy4.d.cts → effects-BQfRbor0.d.cts} +1 -1
  4. package/dist/{effects-BYvL8JUK.d.ts → effects-DKiDkMBB.d.ts} +1 -1
  5. package/dist/index.cjs +110 -104
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +5 -5
  8. package/dist/index.d.ts +5 -5
  9. package/dist/index.js +110 -104
  10. package/dist/index.js.map +1 -1
  11. package/dist/llms-full.txt +1 -1
  12. package/dist/llms.txt +1 -1
  13. package/dist/queue-Bh7O8NnJ.d.ts +117 -0
  14. package/dist/queue-CEg5KSo1.d.cts +117 -0
  15. package/dist/servers/admin/index.cjs +51 -51
  16. package/dist/servers/admin/index.cjs.map +1 -1
  17. package/dist/servers/admin/index.d.cts +9 -1
  18. package/dist/servers/admin/index.d.ts +9 -1
  19. package/dist/servers/admin/index.js +51 -51
  20. package/dist/servers/admin/index.js.map +1 -1
  21. package/dist/servers/crud/index.d.cts +4 -4
  22. package/dist/servers/crud/index.d.ts +4 -4
  23. package/dist/servers/index.cjs +115 -109
  24. package/dist/servers/index.cjs.map +1 -1
  25. package/dist/servers/index.d.cts +6 -6
  26. package/dist/servers/index.d.ts +6 -6
  27. package/dist/servers/index.js +115 -109
  28. package/dist/servers/index.js.map +1 -1
  29. package/dist/sync/index.cjs +67 -61
  30. package/dist/sync/index.cjs.map +1 -1
  31. package/dist/sync/index.d.cts +2 -2
  32. package/dist/sync/index.d.ts +2 -2
  33. package/dist/sync/index.js +67 -61
  34. package/dist/sync/index.js.map +1 -1
  35. package/dist/{types-5Q7JDDba.d.ts → types-DDfd7qc2.d.ts} +5 -0
  36. package/dist/{types-BYPdlGSL.d.cts → types-x1yAVcQa.d.cts} +5 -0
  37. package/package.json +1 -1
  38. package/dist/queue-NFod6hTT.d.ts +0 -62
  39. package/dist/queue-zw2B7GPx.d.cts +0 -62
@@ -191,6 +191,11 @@ interface SystemBackfillOptions {
191
191
  onSuccess?: (path: string) => void;
192
192
  /** Max attempts per document for retryable errors. Default `5`. */
193
193
  maxAttempts?: number;
194
+ /**
195
+ * Flush BulkWriter after this many queued writes to keep memory bounded on
196
+ * large collections. Default `500`.
197
+ */
198
+ flushThreshold?: number;
194
199
  }
195
200
 
196
201
  /**
@@ -191,6 +191,11 @@ interface SystemBackfillOptions {
191
191
  onSuccess?: (path: string) => void;
192
192
  /** Max attempts per document for retryable errors. Default `5`. */
193
193
  maxAttempts?: number;
194
+ /**
195
+ * Flush BulkWriter after this many queued writes to keep memory bounded on
196
+ * large collections. Default `500`.
197
+ */
198
+ flushThreshold?: number;
194
199
  }
195
200
 
196
201
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lpdjs/firestore-repo-service",
3
- "version": "3.0.19",
3
+ "version": "3.0.20",
4
4
  "workspaces": [
5
5
  "test/functions"
6
6
  ],
@@ -1,62 +0,0 @@
1
- import { a as SyncAdapter, S as SyncEvent } from './types-B_FrzmO4.js';
2
-
3
- /**
4
- * Per-repo in-memory batch buffer.
5
- *
6
- * Accumulates {@link SyncEvent}s and flushes them in batches to a
7
- * {@link SqlAdapter}. On flush failure the events are re-published
8
- * to PubSub for retry (if a PubSub re-publisher is provided).
9
- */
10
-
11
- interface SyncQueueOptions {
12
- /** Target adapter to flush data to */
13
- adapter: SyncAdapter;
14
- /** SQL table name or Search index UID */
15
- tableName: string;
16
- /** Primary key column/field name */
17
- primaryKey: string;
18
- /** Max rows per flush (default: 100) */
19
- batchSize?: number;
20
- /** Auto-flush interval in ms (default: 5_000). 0 = manual only. */
21
- flushIntervalMs?: number;
22
- /** Called on flush failure with the failed events. Typically re-publishes to PubSub. */
23
- onFlushError?: (events: SyncEvent[], error: unknown) => Promise<void>;
24
- }
25
- /**
26
- * In-memory buffer that batches sync events per-repo and flushes them
27
- * to a target adapter.
28
- */
29
- declare class SyncQueue {
30
- private buffer;
31
- private flushing;
32
- private flushPromise;
33
- private timer;
34
- private readonly adapter;
35
- private readonly tableName;
36
- private readonly primaryKey;
37
- private readonly batchSize;
38
- private readonly onFlushError?;
39
- constructor(opts: SyncQueueOptions);
40
- /** Number of events waiting in the buffer. */
41
- get size(): number;
42
- /** Push one or more events into the buffer. Triggers auto-flush if batchSize reached. */
43
- enqueue(...events: SyncEvent[]): void;
44
- /**
45
- * Flush all buffered events to the target adapter.
46
- * Upserts and deletes are batched separately.
47
- */
48
- flush(): Promise<void>;
49
- /**
50
- * Drain the buffer to empty.
51
- */
52
- private _drain;
53
- /**
54
- * Flush a single batch (up to `batchSize` events) to the adapter.
55
- */
56
- private _doFlush;
57
- /** Stop the auto-flush timer and flush remaining events. */
58
- shutdown(): Promise<void>;
59
- }
60
-
61
- export { SyncQueue as S };
62
- export type { SyncQueueOptions as a };
@@ -1,62 +0,0 @@
1
- import { a as SyncAdapter, S as SyncEvent } from './types-D78FPJeF.cjs';
2
-
3
- /**
4
- * Per-repo in-memory batch buffer.
5
- *
6
- * Accumulates {@link SyncEvent}s and flushes them in batches to a
7
- * {@link SqlAdapter}. On flush failure the events are re-published
8
- * to PubSub for retry (if a PubSub re-publisher is provided).
9
- */
10
-
11
- interface SyncQueueOptions {
12
- /** Target adapter to flush data to */
13
- adapter: SyncAdapter;
14
- /** SQL table name or Search index UID */
15
- tableName: string;
16
- /** Primary key column/field name */
17
- primaryKey: string;
18
- /** Max rows per flush (default: 100) */
19
- batchSize?: number;
20
- /** Auto-flush interval in ms (default: 5_000). 0 = manual only. */
21
- flushIntervalMs?: number;
22
- /** Called on flush failure with the failed events. Typically re-publishes to PubSub. */
23
- onFlushError?: (events: SyncEvent[], error: unknown) => Promise<void>;
24
- }
25
- /**
26
- * In-memory buffer that batches sync events per-repo and flushes them
27
- * to a target adapter.
28
- */
29
- declare class SyncQueue {
30
- private buffer;
31
- private flushing;
32
- private flushPromise;
33
- private timer;
34
- private readonly adapter;
35
- private readonly tableName;
36
- private readonly primaryKey;
37
- private readonly batchSize;
38
- private readonly onFlushError?;
39
- constructor(opts: SyncQueueOptions);
40
- /** Number of events waiting in the buffer. */
41
- get size(): number;
42
- /** Push one or more events into the buffer. Triggers auto-flush if batchSize reached. */
43
- enqueue(...events: SyncEvent[]): void;
44
- /**
45
- * Flush all buffered events to the target adapter.
46
- * Upserts and deletes are batched separately.
47
- */
48
- flush(): Promise<void>;
49
- /**
50
- * Drain the buffer to empty.
51
- */
52
- private _drain;
53
- /**
54
- * Flush a single batch (up to `batchSize` events) to the adapter.
55
- */
56
- private _doFlush;
57
- /** Stop the auto-flush timer and flush remaining events. */
58
- shutdown(): Promise<void>;
59
- }
60
-
61
- export { SyncQueue as S };
62
- export type { SyncQueueOptions as a };