@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.
Files changed (58) hide show
  1. package/README.md +3 -0
  2. package/dist/{create-servers-6tpqVsSh.d.cts → create-servers-C0znL41U.d.cts} +22 -11
  3. package/dist/{create-servers-U8q943yf.d.ts → create-servers-C2mFtWXg.d.ts} +22 -11
  4. package/dist/history/index.cjs +1 -1
  5. package/dist/history/index.cjs.map +1 -1
  6. package/dist/history/index.d.cts +3 -3
  7. package/dist/history/index.d.ts +3 -3
  8. package/dist/history/index.js +1 -1
  9. package/dist/history/index.js.map +1 -1
  10. package/dist/index.cjs +77 -77
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.cts +10 -10
  13. package/dist/index.d.ts +10 -10
  14. package/dist/index.js +77 -77
  15. package/dist/index.js.map +1 -1
  16. package/dist/llms-full.txt +30 -15
  17. package/dist/llms.txt +1 -1
  18. package/dist/{openapi-Bp4vtku3.d.cts → openapi-C-SpMP9f.d.cts} +1 -1
  19. package/dist/{openapi-D6hEI2lq.d.ts → openapi-DpMY3nFB.d.ts} +1 -1
  20. package/dist/{queue-CrH-eNEN.d.ts → queue-DJjZ4Wp4.d.ts} +1 -1
  21. package/dist/{queue-CiZNShPZ.d.cts → queue-DwazYsJW.d.cts} +1 -1
  22. package/dist/{read-DWUsiHcw.d.cts → read-2sRlBd8o.d.cts} +1 -1
  23. package/dist/{read-_6UEFCDw.d.ts → read-D9TwPubT.d.ts} +1 -1
  24. package/dist/{rules-BB0w7PlS.d.cts → rules-KFfK2bXW.d.cts} +1 -1
  25. package/dist/{rules-6LZ9KkR6.d.ts → rules-OTj6GamJ.d.ts} +1 -1
  26. package/dist/servers/admin/index.d.cts +4 -4
  27. package/dist/servers/admin/index.d.ts +4 -4
  28. package/dist/servers/crud/index.d.cts +8 -8
  29. package/dist/servers/crud/index.d.ts +8 -8
  30. package/dist/servers/index.cjs +29 -29
  31. package/dist/servers/index.cjs.map +1 -1
  32. package/dist/servers/index.d.cts +10 -10
  33. package/dist/servers/index.d.ts +10 -10
  34. package/dist/servers/index.js +29 -29
  35. package/dist/servers/index.js.map +1 -1
  36. package/dist/sync/bigquery.d.cts +3 -3
  37. package/dist/sync/bigquery.d.ts +3 -3
  38. package/dist/sync/index.cjs +45 -45
  39. package/dist/sync/index.cjs.map +1 -1
  40. package/dist/sync/index.d.cts +6 -6
  41. package/dist/sync/index.d.ts +6 -6
  42. package/dist/sync/index.js +45 -45
  43. package/dist/sync/index.js.map +1 -1
  44. package/dist/sync/meilisearch.cjs +2 -2
  45. package/dist/sync/meilisearch.cjs.map +1 -1
  46. package/dist/sync/meilisearch.d.cts +73 -5
  47. package/dist/sync/meilisearch.d.ts +73 -5
  48. package/dist/sync/meilisearch.js +2 -2
  49. package/dist/sync/meilisearch.js.map +1 -1
  50. package/dist/{types-CXQeSrhO.d.ts → types-2xVljLn9.d.ts} +2 -2
  51. package/dist/{types-HZG1KlML.d.ts → types-BCb4TPJZ.d.ts} +27 -3
  52. package/dist/{types-D_snvgmB.d.cts → types-D7-lMoLj.d.cts} +1 -1
  53. package/dist/{types-D9Nm-4pg.d.cts → types-DGtmWhDv.d.cts} +2 -2
  54. package/dist/{types-DgtfcerG.d.ts → types-DR1DlYio.d.ts} +1 -1
  55. package/dist/{types-BwucrwN0.d.cts → types-DS_W0yER.d.cts} +24 -2
  56. package/dist/{types-BwucrwN0.d.ts → types-DS_W0yER.d.ts} +24 -2
  57. package/dist/{types-C5qxru8j.d.cts → types-DpJMhcY_.d.cts} +27 -3
  58. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { a as HistoryConfigForModel } from './types-BwucrwN0.cjs';
1
+ import { a as HistoryConfigForModel } from './types-DS_W0yER.cjs';
2
2
  import * as zod from 'zod';
3
3
  import { DocumentReference, Firestore, DocumentSnapshot, WhereFilterOp } from 'firebase-admin/firestore';
4
4
 
@@ -2,9 +2,9 @@ import { A as AuthUser } from './firebase-auth-Ds5P0kXT.cjs';
2
2
  import { H as HonoServerOptions, O as OpenAPIConfig } from './types-BIZz3sxN.cjs';
3
3
  import { z } from 'zod';
4
4
  import { HttpsOptions } from 'firebase-functions/v2/https';
5
- import { H as HistoryMethods } from './read-DWUsiHcw.cjs';
5
+ import { H as HistoryMethods } from './read-2sRlBd8o.cjs';
6
6
  import { DocumentSnapshot, Query, CollectionReference, WriteBatch, Transaction, DocumentReference } from 'firebase-admin/firestore';
7
- import { Q as QueryOptions, R as RepositoryConfig, G as GetOptions, c as GetResult, e as ExtractReturnDoc, a as RelationConfig, F as FieldPath } from './types-D_snvgmB.cjs';
7
+ import { Q as QueryOptions, R as RepositoryConfig, G as GetOptions, c as GetResult, e as ExtractReturnDoc, a as RelationConfig, F as FieldPath } from './types-D7-lMoLj.cjs';
8
8
 
9
9
  /**
10
10
  * Pagination result with data and cursor information
@@ -1,4 +1,4 @@
1
- import { a as HistoryConfigForModel } from './types-BwucrwN0.js';
1
+ import { a as HistoryConfigForModel } from './types-DS_W0yER.js';
2
2
  import * as zod from 'zod';
3
3
  import { DocumentReference, Firestore, DocumentSnapshot, WhereFilterOp } from 'firebase-admin/firestore';
4
4
 
@@ -1,5 +1,5 @@
1
1
  import { Timestamp } from 'firebase-admin/firestore';
2
- import { onDocumentWritten } from 'firebase-functions/v2/firestore';
2
+ import { DocumentOptions, onDocumentWritten } from 'firebase-functions/v2/firestore';
3
3
 
4
4
  /**
5
5
  * Types and interfaces for the history (change-log) module.
@@ -10,6 +10,12 @@ import { onDocumentWritten } from 'firebase-functions/v2/firestore';
10
10
  * normalising them into a unified {@link HistoryEntry} shape.
11
11
  */
12
12
 
13
+ /**
14
+ * Cloud Functions v2 options forwarded to `onDocumentWritten()` for history triggers.
15
+ * The `document` field is omitted because the library sets it itself from the collection path.
16
+ */
17
+ type TriggerOptions = Omit<DocumentOptions, "document">;
18
+ type HistoryTriggerOptions = TriggerOptions;
13
19
  type HistoryOperation = "create" | "update" | "delete";
14
20
  /**
15
21
  * Detected JS/Firestore type of a value as stored in a history entry.
@@ -117,6 +123,11 @@ interface HistoryConfigBase {
117
123
  ttl?: {
118
124
  days: number;
119
125
  };
126
+ /**
127
+ * Cloud Functions v2 options forwarded to `onDocumentWritten()` for this
128
+ * repository's history trigger (e.g. `region`, `vpcConnector`, `memory`, etc.).
129
+ */
130
+ triggerOptions?: HistoryTriggerOptions;
120
131
  }
121
132
  /**
122
133
  * Strongly-typed history config bound to a model `T`.
@@ -184,6 +195,11 @@ interface HistoryTriggerRepoOverride {
184
195
  * @example "residences/{residenceId}/workshops/{docId}"
185
196
  */
186
197
  triggerPath?: string;
198
+ /**
199
+ * Cloud Functions v2 options forwarded to `onDocumentWritten()` for this
200
+ * repository's history trigger. Overrides global `triggerOptions`.
201
+ */
202
+ triggerOptions?: HistoryTriggerOptions;
187
203
  }
188
204
  interface HistoryTriggersConfig<M = Record<string, any>> {
189
205
  deps: HistoryFirestoreTriggersDep;
@@ -193,8 +209,14 @@ interface HistoryTriggersConfig<M = Record<string, any>> {
193
209
  days: number;
194
210
  };
195
211
  };
212
+ /**
213
+ * Cloud Functions v2 options forwarded to `onDocumentWritten()` for every
214
+ * history trigger handler. Use to configure `region`, `vpcConnector`,
215
+ * `memory`, `cpu`, `timeoutSeconds`, `maxInstances`, `secrets`, etc.
216
+ */
217
+ triggerOptions?: HistoryTriggerOptions;
196
218
  /** Per-repo overrides keyed by repo name in the mapping. */
197
219
  repos?: Partial<Record<keyof M & string, HistoryTriggerRepoOverride>>;
198
220
  }
199
221
 
200
- export type { HistoryTriggersConfig as H, V1HistoryDoc as V, HistoryConfigForModel as a, HistoryListOptions as b, HistoryEntry as c, HistoryRawListOptions as d, V2HistoryDoc as e, HistoryOperation as f, HistoryMeta as g, HistoryFieldChange as h, HistoryValueType as i, HistoryConfigBase as j, HistoryFirestoreTriggersDep as k, HistoryTriggerRepoOverride as l };
222
+ export type { HistoryTriggersConfig as H, TriggerOptions as T, V1HistoryDoc as V, HistoryConfigForModel as a, HistoryListOptions as b, HistoryEntry as c, HistoryRawListOptions as d, V2HistoryDoc as e, HistoryOperation as f, HistoryMeta as g, HistoryFieldChange as h, HistoryValueType as i, HistoryConfigBase as j, HistoryFirestoreTriggersDep as k, HistoryTriggerOptions as l, HistoryTriggerRepoOverride as m };
@@ -1,5 +1,5 @@
1
1
  import { Timestamp } from 'firebase-admin/firestore';
2
- import { onDocumentWritten } from 'firebase-functions/v2/firestore';
2
+ import { DocumentOptions, onDocumentWritten } from 'firebase-functions/v2/firestore';
3
3
 
4
4
  /**
5
5
  * Types and interfaces for the history (change-log) module.
@@ -10,6 +10,12 @@ import { onDocumentWritten } from 'firebase-functions/v2/firestore';
10
10
  * normalising them into a unified {@link HistoryEntry} shape.
11
11
  */
12
12
 
13
+ /**
14
+ * Cloud Functions v2 options forwarded to `onDocumentWritten()` for history triggers.
15
+ * The `document` field is omitted because the library sets it itself from the collection path.
16
+ */
17
+ type TriggerOptions = Omit<DocumentOptions, "document">;
18
+ type HistoryTriggerOptions = TriggerOptions;
13
19
  type HistoryOperation = "create" | "update" | "delete";
14
20
  /**
15
21
  * Detected JS/Firestore type of a value as stored in a history entry.
@@ -117,6 +123,11 @@ interface HistoryConfigBase {
117
123
  ttl?: {
118
124
  days: number;
119
125
  };
126
+ /**
127
+ * Cloud Functions v2 options forwarded to `onDocumentWritten()` for this
128
+ * repository's history trigger (e.g. `region`, `vpcConnector`, `memory`, etc.).
129
+ */
130
+ triggerOptions?: HistoryTriggerOptions;
120
131
  }
121
132
  /**
122
133
  * Strongly-typed history config bound to a model `T`.
@@ -184,6 +195,11 @@ interface HistoryTriggerRepoOverride {
184
195
  * @example "residences/{residenceId}/workshops/{docId}"
185
196
  */
186
197
  triggerPath?: string;
198
+ /**
199
+ * Cloud Functions v2 options forwarded to `onDocumentWritten()` for this
200
+ * repository's history trigger. Overrides global `triggerOptions`.
201
+ */
202
+ triggerOptions?: HistoryTriggerOptions;
187
203
  }
188
204
  interface HistoryTriggersConfig<M = Record<string, any>> {
189
205
  deps: HistoryFirestoreTriggersDep;
@@ -193,8 +209,14 @@ interface HistoryTriggersConfig<M = Record<string, any>> {
193
209
  days: number;
194
210
  };
195
211
  };
212
+ /**
213
+ * Cloud Functions v2 options forwarded to `onDocumentWritten()` for every
214
+ * history trigger handler. Use to configure `region`, `vpcConnector`,
215
+ * `memory`, `cpu`, `timeoutSeconds`, `maxInstances`, `secrets`, etc.
216
+ */
217
+ triggerOptions?: HistoryTriggerOptions;
196
218
  /** Per-repo overrides keyed by repo name in the mapping. */
197
219
  repos?: Partial<Record<keyof M & string, HistoryTriggerRepoOverride>>;
198
220
  }
199
221
 
200
- export type { HistoryTriggersConfig as H, V1HistoryDoc as V, HistoryConfigForModel as a, HistoryListOptions as b, HistoryEntry as c, HistoryRawListOptions as d, V2HistoryDoc as e, HistoryOperation as f, HistoryMeta as g, HistoryFieldChange as h, HistoryValueType as i, HistoryConfigBase as j, HistoryFirestoreTriggersDep as k, HistoryTriggerRepoOverride as l };
222
+ export type { HistoryTriggersConfig as H, TriggerOptions as T, V1HistoryDoc as V, HistoryConfigForModel as a, HistoryListOptions as b, HistoryEntry as c, HistoryRawListOptions as d, V2HistoryDoc as e, HistoryOperation as f, HistoryMeta as g, HistoryFieldChange as h, HistoryValueType as i, HistoryConfigBase as j, HistoryFirestoreTriggersDep as k, HistoryTriggerOptions as l, HistoryTriggerRepoOverride as m };
@@ -1,10 +1,17 @@
1
1
  import { b as AuthExtension } from './firebase-auth-Ds5P0kXT.cjs';
2
- import { onDocumentWritten } from 'firebase-functions/v2/firestore';
2
+ import { onDocumentWritten, DocumentOptions } from 'firebase-functions/v2/firestore';
3
3
  import { onRequest, HttpsOptions } from 'firebase-functions/v2/https';
4
4
  import { onMessagePublished, PubSubOptions } from 'firebase-functions/v2/pubsub';
5
5
  import { z } from 'zod';
6
- import { F as FieldPath } from './types-D_snvgmB.cjs';
6
+ import { F as FieldPath } from './types-D7-lMoLj.cjs';
7
7
 
8
+ /**
9
+ * Cloud Functions v2 options forwarded to `onDocumentWritten()` for every
10
+ * sync trigger handler. The `document` field is omitted because the library sets
11
+ * it itself from `triggerPath` or the repository collection path.
12
+ */
13
+ type TriggerOptions = Omit<DocumentOptions, "document">;
14
+ type SyncTriggerOptions = TriggerOptions;
8
15
  /**
9
16
  * Cloud Functions v2 options forwarded to `onMessagePublished()` for every
10
17
  * sync worker handler. The `topic` field is omitted because the library sets
@@ -231,6 +238,11 @@ interface RepoSyncConfig<F extends string = string> {
231
238
  * Optional custom document transformation function applied after serialization.
232
239
  */
233
240
  transformDoc?: (doc: Record<string, unknown>) => Record<string, unknown>;
241
+ /**
242
+ * Cloud Functions v2 options forwarded to `onDocumentWritten()` for this
243
+ * repository's sync trigger. Overrides global `triggerOptions`.
244
+ */
245
+ triggerOptions?: SyncTriggerOptions;
234
246
  }
235
247
 
236
248
  /**
@@ -317,6 +329,12 @@ interface SyncTriggersConfig<M = Record<string, any>> {
317
329
  deps: Pick<SyncDeps, "firestoreTriggers" | "pubsub">;
318
330
  /** PubSub topic name prefix (topics will be `{prefix}-{repoName}`) */
319
331
  topicPrefix?: string;
332
+ /**
333
+ * Cloud Functions v2 options forwarded to `onDocumentWritten()` for every
334
+ * sync trigger handler. Use to configure `region`, `vpcConnector`,
335
+ * `memory`, `cpu`, `timeoutSeconds`, `maxInstances`, `secrets`, etc.
336
+ */
337
+ triggerOptions?: SyncTriggerOptions;
320
338
  /** Per-repo overrides */
321
339
  repos?: TypedRepoSyncConfigs<M>;
322
340
  }
@@ -449,6 +467,12 @@ interface FirestoreSyncConfig<M = Record<string, any>> {
449
467
  * `memory`, `timeoutSeconds`, `region`, `cpu`, etc.
450
468
  */
451
469
  workerOptions?: SyncWorkerOptions;
470
+ /**
471
+ * Cloud Functions v2 options forwarded to `onDocumentWritten()` for every
472
+ * sync trigger handler. Use to tune `region`, `vpcConnector`, `memory`,
473
+ * `timeoutSeconds`, `maxInstances`, `secrets`, etc.
474
+ */
475
+ triggerOptions?: SyncTriggerOptions;
452
476
  /**
453
477
  * Optional sync admin endpoint. When provided, an `adminsync` handler is
454
478
  * added to `sync.functions` exposing health-check, force-sync, and queue
@@ -459,4 +483,4 @@ interface FirestoreSyncConfig<M = Record<string, any>> {
459
483
  repos?: TypedRepoSyncConfigs<M>;
460
484
  }
461
485
 
462
- export type { AdminHttpsOptions as A, ExtractRepoFieldPaths as E, FirestoreSyncConfig as F, GenerateDDLConfig as G, LogicalType as L, OrFactory as O, PubSubClientDep as P, RepoSyncConfig as R, SyncEvent as S, SyncAdapter as a, SqlAdapter as b, SqlDialect as c, SyncHealthResult as d, SqlTableDef as e, SqlColumn as f, adminsyncConfig as g, SyncTriggersConfig as h, SyncWorkerConfig as i, FirestoreTriggersDep as j, PubSubHandlerDep as k, SyncDeps as l, SyncOperation as m, SyncWorkerOptions as n, adminsyncBasicAuth as o, adminsyncFeaturesFlag as p, ExtractRepoModel as q };
486
+ export type { AdminHttpsOptions as A, ExtractRepoFieldPaths as E, FirestoreSyncConfig as F, GenerateDDLConfig as G, LogicalType as L, OrFactory as O, PubSubClientDep as P, RepoSyncConfig as R, SyncEvent as S, TriggerOptions as T, SyncAdapter as a, SqlAdapter as b, SqlDialect as c, SyncHealthResult as d, SqlTableDef as e, SqlColumn as f, adminsyncConfig as g, SyncTriggersConfig as h, SyncWorkerConfig as i, FirestoreTriggersDep as j, PubSubHandlerDep as k, SyncDeps as l, SyncOperation as m, SyncTriggerOptions as n, SyncWorkerOptions as o, adminsyncBasicAuth as p, adminsyncFeaturesFlag as q, ExtractRepoModel as r };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lpdjs/firestore-repo-service",
3
- "version": "3.0.8",
3
+ "version": "3.0.10",
4
4
  "workspaces": [
5
5
  "test/functions"
6
6
  ],