@lpdjs/firestore-repo-service 2.6.58 → 3.0.2
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/README.md +45 -27
- package/dist/{create-servers-Cp1dwiBW.d.ts → create-servers-2Hw0pkyz.d.ts} +2 -2
- package/dist/{create-servers-vrDTAYk3.d.cts → create-servers-ASLcxpiS.d.cts} +2 -2
- package/dist/index.cjs +106 -94
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +106 -94
- package/dist/index.js.map +1 -1
- package/dist/llms-full.txt +237 -263
- package/dist/llms.txt +5 -4
- package/dist/{queue-DO0af0iY.d.ts → queue-B9jCT62h.d.cts} +8 -23
- package/dist/{queue-LLW6fbO6.d.cts → queue-BWi6TBmf.d.ts} +8 -23
- package/dist/servers/index.cjs +104 -92
- package/dist/servers/index.cjs.map +1 -1
- package/dist/servers/index.d.cts +3 -3
- package/dist/servers/index.d.ts +3 -3
- package/dist/servers/index.js +104 -92
- package/dist/servers/index.js.map +1 -1
- package/dist/sync/bigquery.cjs +5 -5
- package/dist/sync/bigquery.cjs.map +1 -1
- package/dist/sync/bigquery.d.cts +27 -2
- package/dist/sync/bigquery.d.ts +27 -2
- package/dist/sync/bigquery.js +5 -5
- package/dist/sync/bigquery.js.map +1 -1
- package/dist/sync/index.cjs +74 -54
- package/dist/sync/index.cjs.map +1 -1
- package/dist/sync/index.d.cts +62 -16
- package/dist/sync/index.d.ts +62 -16
- package/dist/sync/index.js +74 -54
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/meilisearch.cjs +4 -0
- package/dist/sync/meilisearch.cjs.map +1 -0
- package/dist/sync/meilisearch.d.cts +114 -0
- package/dist/sync/meilisearch.d.ts +114 -0
- package/dist/sync/meilisearch.js +4 -0
- package/dist/sync/meilisearch.js.map +1 -0
- package/dist/{types-BaFkMwNb.d.ts → types-BRPhmKFW.d.ts} +106 -44
- package/dist/{types-CbNcdNkb.d.cts → types-LZ8dyfBz.d.cts} +106 -44
- package/package.json +19 -1
package/dist/llms.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @lpdjs/firestore-repo-service (
|
|
1
|
+
# @lpdjs/firestore-repo-service (v3.0.2)
|
|
2
2
|
|
|
3
3
|
> ⚡ Type-safe Firestore ORM with auto-generated repositories, advanced queries, relations with typed select, pagination with include, batch/bulk operations, aggregations and transactions.
|
|
4
4
|
|
|
@@ -13,13 +13,14 @@ Type-safe Firestore ORM + servers (admin UI, CRUD REST, Hono file-based API, Fir
|
|
|
13
13
|
- [Admin Server](https://frs.lpdjs.fr/guide/admin): The admin UI is built via createServers(repos).admin(...) — a unified factory that auto-binds the repository registry so each entry's repo field is inferred from its key (and so are model field paths in fieldsConfig).
|
|
14
14
|
- [CRUD Server](https://frs.lpdjs.fr/guide/crud): The CRUD REST API server is built via createServers(repos).crud(...) — a unified factory that exposes standard RESTful endpoints and advanced query APIs for all registered repositories.
|
|
15
15
|
- [Change History](https://frs.lpdjs.fr/guide/history): Opt-in, per-repo change-history capture using Firestore triggers, with a typed read API on the configured repository.
|
|
16
|
-
- [Firestore →
|
|
16
|
+
- [Firestore → Storage & Search Sync](https://frs.lpdjs.fr/guide/sync): Automatically replicate Firestore collections to SQL databases (BigQuery, etc.) and search engines (Meilisearch, etc.) via Cloud Pub/Sub.
|
|
17
17
|
- [Hono API Server](https://frs.lpdjs.fr/guide/hono): A typed, file-based HTTP server built on Hono, designed
|
|
18
18
|
|
|
19
19
|
## Package entry points
|
|
20
20
|
- `@lpdjs/firestore-repo-service` — Core ORM: createRepositoryConfig, createRepositoryMapping (lazy Firestore), typed get/query/aggregate/crud/batch/bulk/transaction.
|
|
21
|
-
- `@lpdjs/firestore-repo-service/sync` — Firestore →
|
|
22
|
-
- `@lpdjs/firestore-repo-service/sync/bigquery` — BigQuery adapter for the sync pipeline.
|
|
21
|
+
- `@lpdjs/firestore-repo-service/sync` — Firestore → Storage & Search sync pipeline (triggers + worker + admin).
|
|
22
|
+
- `@lpdjs/firestore-repo-service/sync/bigquery` — BigQuery CDC adapter for the sync pipeline.
|
|
23
|
+
- `@lpdjs/firestore-repo-service/sync/meilisearch` — Meilisearch adapter for full-text search sync pipeline.
|
|
23
24
|
- `@lpdjs/firestore-repo-service/history` — Change-history triggers and read API (createHistoryTriggers).
|
|
24
25
|
- `@lpdjs/firestore-repo-service/servers` — createServers(repos) → admin / crud / sync builders (lazy, definable in separate files).
|
|
25
26
|
- `@lpdjs/firestore-repo-service/servers/admin` — Auto-generated admin UI (Zod forms, filtering, relations).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as SyncAdapter, S as SyncEvent } from './types-LZ8dyfBz.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Per-repo in-memory batch buffer.
|
|
@@ -9,11 +9,11 @@ import { a as SqlAdapter, S as SyncEvent } from './types-BaFkMwNb.js';
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
interface SyncQueueOptions {
|
|
12
|
-
/**
|
|
13
|
-
adapter:
|
|
14
|
-
/** SQL table name */
|
|
12
|
+
/** Target adapter to flush data to */
|
|
13
|
+
adapter: SyncAdapter;
|
|
14
|
+
/** SQL table name or Search index UID */
|
|
15
15
|
tableName: string;
|
|
16
|
-
/** Primary key column name */
|
|
16
|
+
/** Primary key column/field name */
|
|
17
17
|
primaryKey: string;
|
|
18
18
|
/** Max rows per flush (default: 100) */
|
|
19
19
|
batchSize?: number;
|
|
@@ -24,7 +24,7 @@ interface SyncQueueOptions {
|
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* In-memory buffer that batches sync events per-repo and flushes them
|
|
27
|
-
* to a
|
|
27
|
+
* to a target adapter.
|
|
28
28
|
*/
|
|
29
29
|
declare class SyncQueue {
|
|
30
30
|
private buffer;
|
|
@@ -42,31 +42,16 @@ declare class SyncQueue {
|
|
|
42
42
|
/** Push one or more events into the buffer. Triggers auto-flush if batchSize reached. */
|
|
43
43
|
enqueue(...events: SyncEvent[]): void;
|
|
44
44
|
/**
|
|
45
|
-
* Flush all buffered events to the
|
|
45
|
+
* Flush all buffered events to the target adapter.
|
|
46
46
|
* Upserts and deletes are batched separately.
|
|
47
|
-
*
|
|
48
|
-
* Concurrent callers (e.g. several PubSub messages handled in parallel
|
|
49
|
-
* inside the same Cloud Function instance with `concurrency > 1`) all
|
|
50
|
-
* await the same in-flight drain cycle. A drain cycle empties the buffer
|
|
51
|
-
* completely (see {@link _drain}), so by the time `await flush()` resolves
|
|
52
|
-
* every event that was buffered when the call started has been persisted
|
|
53
|
-
* (or handed to `onFlushError`) — which is required for safe PubSub
|
|
54
|
-
* at-least-once ack semantics.
|
|
55
47
|
*/
|
|
56
48
|
flush(): Promise<void>;
|
|
57
49
|
/**
|
|
58
|
-
* Drain the buffer to empty.
|
|
59
|
-
* `batchSize` events, so loop until nothing remains. Without this loop,
|
|
60
|
-
* bursts larger than `batchSize` would leave events buffered after
|
|
61
|
-
* `flush()` resolved — and a container shutdown before the next interval
|
|
62
|
-
* would lose them permanently (breaking at-least-once).
|
|
50
|
+
* Drain the buffer to empty.
|
|
63
51
|
*/
|
|
64
52
|
private _drain;
|
|
65
53
|
/**
|
|
66
54
|
* Flush a single batch (up to `batchSize` events) to the adapter.
|
|
67
|
-
* @returns `true` when the batch was processed (or routed to the error
|
|
68
|
-
* handler) and the loop may continue; `false` when the batch was
|
|
69
|
-
* re-buffered after a failure with no `onFlushError` handler.
|
|
70
55
|
*/
|
|
71
56
|
private _doFlush;
|
|
72
57
|
/** Stop the auto-flush timer and flush remaining events. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as SyncAdapter, S as SyncEvent } from './types-BRPhmKFW.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Per-repo in-memory batch buffer.
|
|
@@ -9,11 +9,11 @@ import { a as SqlAdapter, S as SyncEvent } from './types-CbNcdNkb.cjs';
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
interface SyncQueueOptions {
|
|
12
|
-
/**
|
|
13
|
-
adapter:
|
|
14
|
-
/** SQL table name */
|
|
12
|
+
/** Target adapter to flush data to */
|
|
13
|
+
adapter: SyncAdapter;
|
|
14
|
+
/** SQL table name or Search index UID */
|
|
15
15
|
tableName: string;
|
|
16
|
-
/** Primary key column name */
|
|
16
|
+
/** Primary key column/field name */
|
|
17
17
|
primaryKey: string;
|
|
18
18
|
/** Max rows per flush (default: 100) */
|
|
19
19
|
batchSize?: number;
|
|
@@ -24,7 +24,7 @@ interface SyncQueueOptions {
|
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* In-memory buffer that batches sync events per-repo and flushes them
|
|
27
|
-
* to a
|
|
27
|
+
* to a target adapter.
|
|
28
28
|
*/
|
|
29
29
|
declare class SyncQueue {
|
|
30
30
|
private buffer;
|
|
@@ -42,31 +42,16 @@ declare class SyncQueue {
|
|
|
42
42
|
/** Push one or more events into the buffer. Triggers auto-flush if batchSize reached. */
|
|
43
43
|
enqueue(...events: SyncEvent[]): void;
|
|
44
44
|
/**
|
|
45
|
-
* Flush all buffered events to the
|
|
45
|
+
* Flush all buffered events to the target adapter.
|
|
46
46
|
* Upserts and deletes are batched separately.
|
|
47
|
-
*
|
|
48
|
-
* Concurrent callers (e.g. several PubSub messages handled in parallel
|
|
49
|
-
* inside the same Cloud Function instance with `concurrency > 1`) all
|
|
50
|
-
* await the same in-flight drain cycle. A drain cycle empties the buffer
|
|
51
|
-
* completely (see {@link _drain}), so by the time `await flush()` resolves
|
|
52
|
-
* every event that was buffered when the call started has been persisted
|
|
53
|
-
* (or handed to `onFlushError`) — which is required for safe PubSub
|
|
54
|
-
* at-least-once ack semantics.
|
|
55
47
|
*/
|
|
56
48
|
flush(): Promise<void>;
|
|
57
49
|
/**
|
|
58
|
-
* Drain the buffer to empty.
|
|
59
|
-
* `batchSize` events, so loop until nothing remains. Without this loop,
|
|
60
|
-
* bursts larger than `batchSize` would leave events buffered after
|
|
61
|
-
* `flush()` resolved — and a container shutdown before the next interval
|
|
62
|
-
* would lose them permanently (breaking at-least-once).
|
|
50
|
+
* Drain the buffer to empty.
|
|
63
51
|
*/
|
|
64
52
|
private _drain;
|
|
65
53
|
/**
|
|
66
54
|
* Flush a single batch (up to `batchSize` events) to the adapter.
|
|
67
|
-
* @returns `true` when the batch was processed (or routed to the error
|
|
68
|
-
* handler) and the loop may continue; `false` when the batch was
|
|
69
|
-
* re-buffered after a failure with no `onFlushError` handler.
|
|
70
55
|
*/
|
|
71
56
|
private _doFlush;
|
|
72
57
|
/** Stop the auto-flush timer and flush remaining events. */
|