@lpdjs/firestore-repo-service 3.0.8 → 3.0.10
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 +3 -0
- package/dist/{create-servers-6tpqVsSh.d.cts → create-servers-C0znL41U.d.cts} +22 -11
- package/dist/{create-servers-U8q943yf.d.ts → create-servers-C2mFtWXg.d.ts} +22 -11
- package/dist/history/index.cjs +1 -1
- package/dist/history/index.cjs.map +1 -1
- package/dist/history/index.d.cts +3 -3
- package/dist/history/index.d.ts +3 -3
- package/dist/history/index.js +1 -1
- package/dist/history/index.js.map +1 -1
- package/dist/index.cjs +77 -77
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +77 -77
- package/dist/index.js.map +1 -1
- package/dist/llms-full.txt +30 -15
- package/dist/llms.txt +1 -1
- package/dist/{openapi-Bp4vtku3.d.cts → openapi-C-SpMP9f.d.cts} +1 -1
- package/dist/{openapi-D6hEI2lq.d.ts → openapi-DpMY3nFB.d.ts} +1 -1
- package/dist/{queue-CrH-eNEN.d.ts → queue-DJjZ4Wp4.d.ts} +1 -1
- package/dist/{queue-CiZNShPZ.d.cts → queue-DwazYsJW.d.cts} +1 -1
- package/dist/{read-DWUsiHcw.d.cts → read-2sRlBd8o.d.cts} +1 -1
- package/dist/{read-_6UEFCDw.d.ts → read-D9TwPubT.d.ts} +1 -1
- package/dist/{rules-BB0w7PlS.d.cts → rules-KFfK2bXW.d.cts} +1 -1
- package/dist/{rules-6LZ9KkR6.d.ts → rules-OTj6GamJ.d.ts} +1 -1
- package/dist/servers/admin/index.d.cts +4 -4
- package/dist/servers/admin/index.d.ts +4 -4
- package/dist/servers/crud/index.d.cts +8 -8
- package/dist/servers/crud/index.d.ts +8 -8
- package/dist/servers/index.cjs +29 -29
- package/dist/servers/index.cjs.map +1 -1
- package/dist/servers/index.d.cts +10 -10
- package/dist/servers/index.d.ts +10 -10
- package/dist/servers/index.js +29 -29
- package/dist/servers/index.js.map +1 -1
- package/dist/sync/bigquery.d.cts +3 -3
- package/dist/sync/bigquery.d.ts +3 -3
- package/dist/sync/index.cjs +45 -45
- package/dist/sync/index.cjs.map +1 -1
- package/dist/sync/index.d.cts +6 -6
- package/dist/sync/index.d.ts +6 -6
- package/dist/sync/index.js +45 -45
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/meilisearch.cjs +2 -2
- package/dist/sync/meilisearch.cjs.map +1 -1
- package/dist/sync/meilisearch.d.cts +73 -5
- package/dist/sync/meilisearch.d.ts +73 -5
- package/dist/sync/meilisearch.js +2 -2
- package/dist/sync/meilisearch.js.map +1 -1
- package/dist/{types-CXQeSrhO.d.ts → types-2xVljLn9.d.ts} +2 -2
- package/dist/{types-HZG1KlML.d.ts → types-BCb4TPJZ.d.ts} +27 -3
- package/dist/{types-D_snvgmB.d.cts → types-D7-lMoLj.d.cts} +1 -1
- package/dist/{types-D9Nm-4pg.d.cts → types-DGtmWhDv.d.cts} +2 -2
- package/dist/{types-DgtfcerG.d.ts → types-DR1DlYio.d.ts} +1 -1
- package/dist/{types-BwucrwN0.d.cts → types-DS_W0yER.d.cts} +24 -2
- package/dist/{types-BwucrwN0.d.ts → types-DS_W0yER.d.ts} +24 -2
- package/dist/{types-C5qxru8j.d.cts → types-DpJMhcY_.d.cts} +27 -3
- package/package.json +1 -1
package/dist/llms-full.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @lpdjs/firestore-repo-service (v3.0.
|
|
1
|
+
# @lpdjs/firestore-repo-service (v3.0.10) — full documentation
|
|
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
|
|
|
@@ -1437,20 +1437,23 @@ Two equivalent ways:
|
|
|
1437
1437
|
|
|
1438
1438
|
#### Via `createServers` (recommended)
|
|
1439
1439
|
|
|
1440
|
-
`servers.history()` lives next to `servers.api()` / `servers.sync()` and reuses the same `repos` instance.
|
|
1440
|
+
`servers.history()` lives next to `servers.api()` / `servers.sync()` and reuses the same `repos` instance. History triggers automatically inherit `triggerOptions` declared on `createServers` (or can be configured directly via `triggerOptions: { region, vpcConnector, memory, ... }`).
|
|
1441
1441
|
|
|
1442
1442
|
```typescript
|
|
1443
1443
|
import { createServers } from "@lpdjs/firestore-repo-service";
|
|
1444
1444
|
import * as firestoreTriggers from "firebase-functions/v2/firestore";
|
|
1445
1445
|
import { repos } from "./repos";
|
|
1446
1446
|
|
|
1447
|
-
const servers = createServers(
|
|
1447
|
+
const servers = createServers(repos, {
|
|
1448
|
+
triggerOptions: { region: "europe-west1" },
|
|
1449
|
+
});
|
|
1448
1450
|
|
|
1449
1451
|
export const historyTriggers = servers.history({
|
|
1450
1452
|
deps: { onDocumentWritten: firestoreTriggers.onDocumentWritten },
|
|
1451
|
-
defaults: { ttl: {
|
|
1453
|
+
defaults: { ttl: { days: 365 } },
|
|
1454
|
+
triggerOptions: { memory: "256MiB" }, // merges with region: "europe-west1"
|
|
1452
1455
|
repos: {
|
|
1453
|
-
residences: {
|
|
1456
|
+
residences: { triggerPath: "residences/{docId}" },
|
|
1454
1457
|
},
|
|
1455
1458
|
});
|
|
1456
1459
|
|
|
@@ -1629,6 +1632,8 @@ const sync = servers.sync({
|
|
|
1629
1632
|
],
|
|
1630
1633
|
topicPrefix: "firestore-sync",
|
|
1631
1634
|
autoMigrate: true,
|
|
1635
|
+
workerOptions: { region: "europe-west1", concurrency: 20, memory: "512MiB" },
|
|
1636
|
+
triggerOptions: { region: "europe-west1" },
|
|
1632
1637
|
admin: {
|
|
1633
1638
|
httpsOptions: { invoker: "public" },
|
|
1634
1639
|
auth: { type: "basic", username: "admin", password: "secret" },
|
|
@@ -1677,6 +1682,7 @@ The unified wrapper that creates triggers, workers, and the optional admin serve
|
|
|
1677
1682
|
| `flushIntervalMs` | `number` | `5000` | Flush interval in ms |
|
|
1678
1683
|
| `autoMigrate` | `boolean` | `false` | Auto-create/migrate tables and indexes on first event |
|
|
1679
1684
|
| `workerOptions` | `SyncWorkerOptions` | — | CF v2 options for the worker (`concurrency`, `maxInstances`, …) |
|
|
1685
|
+
| `triggerOptions` | `TriggerOptions` | — | CF v2 options for the triggers (`region`, `vpcConnector`, …) |
|
|
1680
1686
|
| `admin` | `adminsyncConfig` | — | Optional admin endpoint config |
|
|
1681
1687
|
| `repos` | `TypedRepoSyncConfigs` | — | Per-repo overrides |
|
|
1682
1688
|
|
|
@@ -1788,13 +1794,14 @@ The helper has been removed in favour of application-level versioning (see above
|
|
|
1788
1794
|
|
|
1789
1795
|
## Tuning & Scaling
|
|
1790
1796
|
|
|
1791
|
-
|
|
1797
|
+
Four knobs let you trade latency, throughput, VPC/location and BigQuery quota pressure:
|
|
1792
1798
|
|
|
1793
|
-
| Option | Where
|
|
1794
|
-
| ----------------- |
|
|
1795
|
-
| `batchSize` | top-level config
|
|
1796
|
-
| `flushIntervalMs` | top-level config
|
|
1797
|
-
| `workerOptions` | top-level config
|
|
1799
|
+
| Option | Where | Default | What it controls |
|
|
1800
|
+
| ----------------- | ----------------------- | ------- | --------------------------------------------------------------------------- |
|
|
1801
|
+
| `batchSize` | top-level config | `100` | Max rows merged per flush batch |
|
|
1802
|
+
| `flushIntervalMs` | top-level config | `5000` | Max time a row sits in the in-memory queue before being flushed |
|
|
1803
|
+
| `workerOptions` | top-level config | — | Cloud Functions v2 options for every worker handler (concurrency, scaling…) |
|
|
1804
|
+
| `triggerOptions` | top-level or per-repo | — | Cloud Functions v2 options for Firestore triggers (region, VPC, RAM…) |
|
|
1798
1805
|
|
|
1799
1806
|
```typescript
|
|
1800
1807
|
createServers(repos).sync({
|
|
@@ -1808,14 +1815,22 @@ createServers(repos).sync({
|
|
|
1808
1815
|
memory: "512MiB",
|
|
1809
1816
|
timeoutSeconds: 120,
|
|
1810
1817
|
region: "europe-west1",
|
|
1811
|
-
retry: true, // PubSub
|
|
1818
|
+
retry: true, // PubSub retry on unhandled throw → no dropped events
|
|
1819
|
+
},
|
|
1820
|
+
triggerOptions: {
|
|
1821
|
+
region: "europe-west1",
|
|
1822
|
+
vpcConnector: "my-connector",
|
|
1812
1823
|
},
|
|
1813
1824
|
});
|
|
1814
1825
|
```
|
|
1815
1826
|
|
|
1816
|
-
`workerOptions` is forwarded
|
|
1817
|
-
|
|
1818
|
-
|
|
1827
|
+
`workerOptions` is forwarded verbatim to `onMessagePublished({ topic, ...workerOptions }, …)`.
|
|
1828
|
+
All fields of [`PubSubOptions`](https://firebase.google.com/docs/reference/functions/2nd-gen/node/firebase-functions.v2.pubsub.pubsuboptions)
|
|
1829
|
+
are accepted (`cpu`, `vpcConnector`, `serviceAccount`, `secrets`, etc.).
|
|
1830
|
+
|
|
1831
|
+
`triggerOptions` is forwarded verbatim to `onDocumentWritten({ document, ...triggerOptions }, …)`.
|
|
1832
|
+
All fields of [`DocumentOptions`](https://firebase.google.com/docs/reference/functions/2nd-gen/node/firebase-functions.v2.firestore.documentoptions)
|
|
1833
|
+
are accepted (`region`, `vpcConnector`, `vpcConnectorEgressSettings`, `memory`, `cpu`, `timeoutSeconds`, `secrets`, etc.). Can also be declared globally via `createServers(repos, { triggerOptions })` (inherited by both sync and history) or overridden per repo via `repos.<name>.triggerOptions`.
|
|
1819
1834
|
|
|
1820
1835
|
### Concurrency & PubSub ack semantics
|
|
1821
1836
|
|
package/dist/llms.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @lpdjs/firestore-repo-service (v3.0.
|
|
1
|
+
# @lpdjs/firestore-repo-service (v3.0.10)
|
|
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
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentReference } from 'firebase-admin/firestore';
|
|
2
|
-
import { b as HistoryListOptions, c as HistoryEntry, d as HistoryRawListOptions, V as V1HistoryDoc, e as V2HistoryDoc, f as HistoryOperation, g as HistoryMeta, a as HistoryConfigForModel } from './types-
|
|
2
|
+
import { b as HistoryListOptions, c as HistoryEntry, d as HistoryRawListOptions, V as V1HistoryDoc, e as V2HistoryDoc, f as HistoryOperation, g as HistoryMeta, a as HistoryConfigForModel } from './types-DS_W0yER.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `repo.history.*` read API.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentReference } from 'firebase-admin/firestore';
|
|
2
|
-
import { b as HistoryListOptions, c as HistoryEntry, d as HistoryRawListOptions, V as V1HistoryDoc, e as V2HistoryDoc, f as HistoryOperation, g as HistoryMeta, a as HistoryConfigForModel } from './types-
|
|
2
|
+
import { b as HistoryListOptions, c as HistoryEntry, d as HistoryRawListOptions, V as V1HistoryDoc, e as V2HistoryDoc, f as HistoryOperation, g as HistoryMeta, a as HistoryConfigForModel } from './types-DS_W0yER.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `repo.history.*` read API.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as AuthUser } from './firebase-auth-Ds5P0kXT.cjs';
|
|
2
|
-
import { D as DeepDiffReturn, k as RulesMap, f as CrudUpdateRuleContext } from './types-
|
|
2
|
+
import { D as DeepDiffReturn, k as RulesMap, f as CrudUpdateRuleContext } from './types-DGtmWhDv.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Computes a typed diff between the existing document (`before`) and the incoming partial changes (`changesInput`).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as AuthUser } from './firebase-auth-Ds5P0kXT.js';
|
|
2
|
-
import { D as DeepDiffReturn, k as RulesMap, f as CrudUpdateRuleContext } from './types-
|
|
2
|
+
import { D as DeepDiffReturn, k as RulesMap, f as CrudUpdateRuleContext } from './types-2xVljLn9.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Computes a typed diff between the existing document (`before`) and the incoming partial changes (`changesInput`).
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { HttpsOptions } from 'firebase-functions/v2/https';
|
|
3
|
-
import { C as ConfiguredRepository, l as RelationalFieldMeta, F as FieldRole, S as SecurityHeadersOptions } from '../../types-
|
|
4
|
-
import { R as RepositoryConfig, F as FieldPath } from '../../types-
|
|
3
|
+
import { C as ConfiguredRepository, l as RelationalFieldMeta, F as FieldRole, S as SecurityHeadersOptions } from '../../types-DGtmWhDv.cjs';
|
|
4
|
+
import { R as RepositoryConfig, F as FieldPath } from '../../types-D7-lMoLj.cjs';
|
|
5
5
|
import { b as AuthExtension, M as Middleware } from '../../firebase-auth-Ds5P0kXT.cjs';
|
|
6
6
|
export { h as MiniRouter, R as RouteHandler } from '../../firebase-auth-Ds5P0kXT.cjs';
|
|
7
7
|
import '../../types-BIZz3sxN.cjs';
|
|
8
8
|
import 'hono';
|
|
9
|
-
import '../../read-
|
|
9
|
+
import '../../read-2sRlBd8o.cjs';
|
|
10
10
|
import 'firebase-admin/firestore';
|
|
11
|
-
import '../../types-
|
|
11
|
+
import '../../types-DS_W0yER.cjs';
|
|
12
12
|
import 'firebase-functions/v2/firestore';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { HttpsOptions } from 'firebase-functions/v2/https';
|
|
3
|
-
import { C as ConfiguredRepository, l as RelationalFieldMeta, F as FieldRole, S as SecurityHeadersOptions } from '../../types-
|
|
4
|
-
import { R as RepositoryConfig, F as FieldPath } from '../../types-
|
|
3
|
+
import { C as ConfiguredRepository, l as RelationalFieldMeta, F as FieldRole, S as SecurityHeadersOptions } from '../../types-2xVljLn9.js';
|
|
4
|
+
import { R as RepositoryConfig, F as FieldPath } from '../../types-DR1DlYio.js';
|
|
5
5
|
import { b as AuthExtension, M as Middleware } from '../../firebase-auth-Ds5P0kXT.js';
|
|
6
6
|
export { h as MiniRouter, R as RouteHandler } from '../../firebase-auth-Ds5P0kXT.js';
|
|
7
7
|
import '../../types-DSMiiOrU.js';
|
|
8
8
|
import 'hono';
|
|
9
|
-
import '../../read-
|
|
9
|
+
import '../../read-D9TwPubT.js';
|
|
10
10
|
import 'firebase-admin/firestore';
|
|
11
|
-
import '../../types-
|
|
11
|
+
import '../../types-DS_W0yER.js';
|
|
12
12
|
import 'firebase-functions/v2/firestore';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { HttpsOptions } from 'firebase-functions/v2/https';
|
|
2
|
-
import { C as ConfiguredRepository, a as CrudServerOptions } from '../../types-
|
|
3
|
-
export { A as ApiResponse, b as CrudRepoConfig, c as CrudRepoEntry, d as CrudRepoRegistry, e as CrudRules, f as CrudUpdateRuleContext, D as DeepDiffReturn, F as FieldRole, I as IndexErrorCallback, g as IndexErrorContext, L as ListResponseData, O as OpenAPISpecOptions, Q as QueryRequestBody, R as RepoFieldPath, h as RepoRelationKeys, i as Rule, j as RuleResult, k as RulesMap, U as UserFieldPath } from '../../types-
|
|
4
|
-
import { O as OpenAPIDocument } from '../../openapi-
|
|
5
|
-
export { g as generateOpenAPISpec } from '../../openapi-
|
|
6
|
-
export { a as applyRules, c as computeDeepDiff, b as createBeforeRules, d as createRules } from '../../rules-
|
|
2
|
+
import { C as ConfiguredRepository, a as CrudServerOptions } from '../../types-DGtmWhDv.cjs';
|
|
3
|
+
export { A as ApiResponse, b as CrudRepoConfig, c as CrudRepoEntry, d as CrudRepoRegistry, e as CrudRules, f as CrudUpdateRuleContext, D as DeepDiffReturn, F as FieldRole, I as IndexErrorCallback, g as IndexErrorContext, L as ListResponseData, O as OpenAPISpecOptions, Q as QueryRequestBody, R as RepoFieldPath, h as RepoRelationKeys, i as Rule, j as RuleResult, k as RulesMap, U as UserFieldPath } from '../../types-DGtmWhDv.cjs';
|
|
4
|
+
import { O as OpenAPIDocument } from '../../openapi-C-SpMP9f.cjs';
|
|
5
|
+
export { g as generateOpenAPISpec } from '../../openapi-C-SpMP9f.cjs';
|
|
6
|
+
export { a as applyRules, c as computeDeepDiff, b as createBeforeRules, d as createRules } from '../../rules-KFfK2bXW.cjs';
|
|
7
7
|
import '../../firebase-auth-Ds5P0kXT.cjs';
|
|
8
8
|
import '../../types-BIZz3sxN.cjs';
|
|
9
9
|
import 'zod';
|
|
10
10
|
import 'hono';
|
|
11
|
-
import '../../read-
|
|
11
|
+
import '../../read-2sRlBd8o.cjs';
|
|
12
12
|
import 'firebase-admin/firestore';
|
|
13
|
-
import '../../types-
|
|
13
|
+
import '../../types-DS_W0yER.cjs';
|
|
14
14
|
import 'firebase-functions/v2/firestore';
|
|
15
|
-
import '../../types-
|
|
15
|
+
import '../../types-D7-lMoLj.cjs';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @module servers/crud
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { HttpsOptions } from 'firebase-functions/v2/https';
|
|
2
|
-
import { C as ConfiguredRepository, a as CrudServerOptions } from '../../types-
|
|
3
|
-
export { A as ApiResponse, b as CrudRepoConfig, c as CrudRepoEntry, d as CrudRepoRegistry, e as CrudRules, f as CrudUpdateRuleContext, D as DeepDiffReturn, F as FieldRole, I as IndexErrorCallback, g as IndexErrorContext, L as ListResponseData, O as OpenAPISpecOptions, Q as QueryRequestBody, R as RepoFieldPath, h as RepoRelationKeys, i as Rule, j as RuleResult, k as RulesMap, U as UserFieldPath } from '../../types-
|
|
4
|
-
import { O as OpenAPIDocument } from '../../openapi-
|
|
5
|
-
export { g as generateOpenAPISpec } from '../../openapi-
|
|
6
|
-
export { a as applyRules, c as computeDeepDiff, b as createBeforeRules, d as createRules } from '../../rules-
|
|
2
|
+
import { C as ConfiguredRepository, a as CrudServerOptions } from '../../types-2xVljLn9.js';
|
|
3
|
+
export { A as ApiResponse, b as CrudRepoConfig, c as CrudRepoEntry, d as CrudRepoRegistry, e as CrudRules, f as CrudUpdateRuleContext, D as DeepDiffReturn, F as FieldRole, I as IndexErrorCallback, g as IndexErrorContext, L as ListResponseData, O as OpenAPISpecOptions, Q as QueryRequestBody, R as RepoFieldPath, h as RepoRelationKeys, i as Rule, j as RuleResult, k as RulesMap, U as UserFieldPath } from '../../types-2xVljLn9.js';
|
|
4
|
+
import { O as OpenAPIDocument } from '../../openapi-DpMY3nFB.js';
|
|
5
|
+
export { g as generateOpenAPISpec } from '../../openapi-DpMY3nFB.js';
|
|
6
|
+
export { a as applyRules, c as computeDeepDiff, b as createBeforeRules, d as createRules } from '../../rules-OTj6GamJ.js';
|
|
7
7
|
import '../../firebase-auth-Ds5P0kXT.js';
|
|
8
8
|
import '../../types-DSMiiOrU.js';
|
|
9
9
|
import 'zod';
|
|
10
10
|
import 'hono';
|
|
11
|
-
import '../../read-
|
|
11
|
+
import '../../read-D9TwPubT.js';
|
|
12
12
|
import 'firebase-admin/firestore';
|
|
13
|
-
import '../../types-
|
|
13
|
+
import '../../types-DS_W0yER.js';
|
|
14
14
|
import 'firebase-functions/v2/firestore';
|
|
15
|
-
import '../../types-
|
|
15
|
+
import '../../types-DR1DlYio.js';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @module servers/crud
|