@lpdjs/firestore-repo-service 3.0.13 → 3.0.15

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 (75) hide show
  1. package/dist/actor-context-DQZgWqj3.d.cts +117 -0
  2. package/dist/actor-context-DQZgWqj3.d.ts +117 -0
  3. package/dist/{create-servers-LyRLAOh3.d.cts → create-servers-B5Z5v2SP.d.cts} +11 -5
  4. package/dist/{create-servers-Db1xUY2N.d.ts → create-servers-p1-jJNTG.d.ts} +11 -5
  5. package/dist/history/index.cjs +1 -1
  6. package/dist/history/index.cjs.map +1 -1
  7. package/dist/history/index.d.cts +67 -7
  8. package/dist/history/index.d.ts +67 -7
  9. package/dist/history/index.js +1 -1
  10. package/dist/history/index.js.map +1 -1
  11. package/dist/index.cjs +81 -81
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +20 -14
  14. package/dist/index.d.ts +20 -14
  15. package/dist/index.js +81 -81
  16. package/dist/index.js.map +1 -1
  17. package/dist/llms-full.txt +1 -1
  18. package/dist/llms.txt +1 -1
  19. package/dist/{openapi-QVpqnnes.d.cts → openapi-B9utXiEH.d.cts} +1 -1
  20. package/dist/{openapi-CNIA7QRw.d.ts → openapi-Bsqq2zgh.d.ts} +1 -1
  21. package/dist/{queue-BEB-ujA3.d.ts → queue-NFod6hTT.d.ts} +1 -1
  22. package/dist/{queue-CpHe6M5j.d.cts → queue-zw2B7GPx.d.cts} +1 -1
  23. package/dist/{read-15-TcgCz.d.ts → read-BPov7lws.d.ts} +30 -7
  24. package/dist/{read-B15YaPyR.d.cts → read-Dfah1PPl.d.cts} +30 -7
  25. package/dist/{rules-Cafrkb9v.d.ts → rules-18wH7Uak.d.ts} +1 -1
  26. package/dist/{rules-Bu2NB7Eb.d.cts → rules-oSXoV4Js.d.cts} +1 -1
  27. package/dist/servers/admin/index.cjs +5 -5
  28. package/dist/servers/admin/index.cjs.map +1 -1
  29. package/dist/servers/admin/index.d.cts +5 -4
  30. package/dist/servers/admin/index.d.ts +5 -4
  31. package/dist/servers/admin/index.js +5 -5
  32. package/dist/servers/admin/index.js.map +1 -1
  33. package/dist/servers/crud/index.cjs +2 -2
  34. package/dist/servers/crud/index.cjs.map +1 -1
  35. package/dist/servers/crud/index.d.cts +10 -9
  36. package/dist/servers/crud/index.d.ts +10 -9
  37. package/dist/servers/crud/index.js +2 -2
  38. package/dist/servers/crud/index.js.map +1 -1
  39. package/dist/servers/hono/index.cjs +14 -14
  40. package/dist/servers/hono/index.cjs.map +1 -1
  41. package/dist/servers/hono/index.d.cts +11 -3
  42. package/dist/servers/hono/index.d.ts +11 -3
  43. package/dist/servers/hono/index.js +14 -14
  44. package/dist/servers/hono/index.js.map +1 -1
  45. package/dist/servers/index.cjs +94 -94
  46. package/dist/servers/index.cjs.map +1 -1
  47. package/dist/servers/index.d.cts +13 -12
  48. package/dist/servers/index.d.ts +13 -12
  49. package/dist/servers/index.js +94 -94
  50. package/dist/servers/index.js.map +1 -1
  51. package/dist/sync/bigquery.d.cts +2 -2
  52. package/dist/sync/bigquery.d.ts +2 -2
  53. package/dist/sync/index.cjs +55 -55
  54. package/dist/sync/index.cjs.map +1 -1
  55. package/dist/sync/index.d.cts +6 -6
  56. package/dist/sync/index.d.ts +6 -6
  57. package/dist/sync/index.js +55 -55
  58. package/dist/sync/index.js.map +1 -1
  59. package/dist/sync/meilisearch.cjs +2 -2
  60. package/dist/sync/meilisearch.cjs.map +1 -1
  61. package/dist/sync/meilisearch.d.cts +2 -2
  62. package/dist/sync/meilisearch.d.ts +2 -2
  63. package/dist/sync/meilisearch.js +2 -2
  64. package/dist/sync/meilisearch.js.map +1 -1
  65. package/dist/{types-o-9qoExc.d.cts → types-BDTx8VPg.d.cts} +8 -0
  66. package/dist/{types-CNseHqF7.d.cts → types-BGh5_2fl.d.cts} +4 -4
  67. package/dist/{types-DGQURFSq.d.ts → types-B_FrzmO4.d.ts} +1 -1
  68. package/dist/{types-DmXW_fVz.d.ts → types-Cc6lelk1.d.ts} +4 -4
  69. package/dist/{types--RamYGF1.d.cts → types-D6zvWzRt.d.cts} +96 -2
  70. package/dist/{types--RamYGF1.d.ts → types-D6zvWzRt.d.ts} +96 -2
  71. package/dist/{types-VVuLlmfc.d.cts → types-D78FPJeF.d.cts} +1 -1
  72. package/dist/{types-B51LYvQZ.d.cts → types-Dc3lX99O.d.cts} +20 -19
  73. package/dist/{types-Ci0dGbuW.d.ts → types-DgFJLwAu.d.ts} +20 -19
  74. package/dist/{types-D3W_RaDA.d.ts → types-w1rEqs0Z.d.ts} +8 -0
  75. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- # @lpdjs/firestore-repo-service (v3.0.13) — full documentation
1
+ # @lpdjs/firestore-repo-service (v3.0.15) — 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
 
package/dist/llms.txt CHANGED
@@ -1,4 +1,4 @@
1
- # @lpdjs/firestore-repo-service (v3.0.13)
1
+ # @lpdjs/firestore-repo-service (v3.0.15)
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,4 +1,4 @@
1
- import { d as CrudRepoRegistry, O as OpenAPISpecOptions } from './types-CNseHqF7.cjs';
1
+ import { d as CrudRepoRegistry, O as OpenAPISpecOptions } from './types-BGh5_2fl.cjs';
2
2
 
3
3
  /**
4
4
  * OpenAPI 3.1 specification generator for the CRUD server.
@@ -1,4 +1,4 @@
1
- import { d as CrudRepoRegistry, O as OpenAPISpecOptions } from './types-DmXW_fVz.js';
1
+ import { d as CrudRepoRegistry, O as OpenAPISpecOptions } from './types-Cc6lelk1.js';
2
2
 
3
3
  /**
4
4
  * OpenAPI 3.1 specification generator for the CRUD server.
@@ -1,4 +1,4 @@
1
- import { a as SyncAdapter, S as SyncEvent } from './types-DGQURFSq.js';
1
+ import { a as SyncAdapter, S as SyncEvent } from './types-B_FrzmO4.js';
2
2
 
3
3
  /**
4
4
  * Per-repo in-memory batch buffer.
@@ -1,4 +1,4 @@
1
- import { a as SyncAdapter, S as SyncEvent } from './types-VVuLlmfc.cjs';
1
+ import { a as SyncAdapter, S as SyncEvent } from './types-D78FPJeF.cjs';
2
2
 
3
3
  /**
4
4
  * Per-repo in-memory batch buffer.
@@ -1,5 +1,5 @@
1
1
  import { DocumentReference } from 'firebase-admin/firestore';
2
- import { a as HistoryListOptions, b as HistoryEntry, c as HistoryRawListOptions, V as V1HistoryDoc, d as V2HistoryDoc, e as HistoryOperation, f as HistoryMeta, g as HistoryConfigForModel } from './types--RamYGF1.js';
2
+ import { a as HistoryListOptions, b as HistoryEntry, c as HistoryRawListOptions, V as V1HistoryDoc, d as V2HistoryDoc, e as HistoryOperation, f as HistoryMeta, g as HistoryCustomData, h as HistoryCustomInput, i as HistoryConfigForModel } from './types-D6zvWzRt.js';
3
3
 
4
4
  /**
5
5
  * `repo.history.*` read API.
@@ -124,11 +124,11 @@ interface HistoryMethods<T, PathArgs extends readonly unknown[] = [string]> {
124
124
  * Convenience wrapper around {@link list} filtering on the operation type.
125
125
  *
126
126
  * @param args - `[...pathArgs, operation, options?]` where `operation` is
127
- * `"create" | "update" | "delete"`.
127
+ * `"create" | "update" | "delete" | "custom"`.
128
128
  *
129
129
  * @example
130
130
  * ```ts
131
- * await repos.residences.history!.byOperation("residence_123", "delete");
131
+ * await repos.residences.history!.byOperation("residence_123", "custom");
132
132
  * ```
133
133
  */
134
134
  byOperation(...args: [...PathArgs, HistoryOperation, HistoryListOptions<T>?]): Promise<HistoryEntry<T>[]>;
@@ -138,17 +138,17 @@ interface HistoryMethods<T, PathArgs extends readonly unknown[] = [string]> {
138
138
  * Useful when:
139
139
  * - You already have richer business context than the trigger can extract
140
140
  * (e.g. inside an HTTP handler that knows the authenticated user).
141
- * - You want to record an event that isn't a Firestore write (e.g.
142
- * `meta.reason = "exported-to-pdf"`).
141
+ * - You want to record a diff manually alongside explicit `meta` or `custom`.
143
142
  *
144
143
  * Honours the same `include` / `exclude` / meta auto-exclusion rules as
145
- * the trigger. Returns `null` when the diff is empty (no changes recorded).
144
+ * the trigger. Returns `null` when `operation === "update"` and the diff is
145
+ * empty (no changes recorded).
146
146
  *
147
147
  * > ⚠️ Use sparingly — combining manual records with the trigger can
148
148
  * > produce duplicate entries if both fire for the same write.
149
149
  *
150
150
  * @param args - `[...pathArgs, payload]` where `payload` is
151
- * `{ operation, before?, after?, meta? }`.
151
+ * `{ operation, before?, after?, meta?, custom? }`.
152
152
  */
153
153
  recordManual(...args: [
154
154
  ...PathArgs,
@@ -157,8 +157,31 @@ interface HistoryMethods<T, PathArgs extends readonly unknown[] = [string]> {
157
157
  before?: T | null;
158
158
  after?: T | null;
159
159
  meta?: HistoryMeta;
160
+ custom?: HistoryCustomData;
160
161
  }
161
162
  ]): Promise<HistoryEntry<T> | null>;
163
+ /**
164
+ * Record a custom business action (`operation: "custom"`) independent of
165
+ * model fields (e.g. manual invoice creation, PDF export, email sent).
166
+ *
167
+ * Automatically resolves the current actor from `AsyncLocalStorage` (Hono
168
+ * request / `withActor`, falling back to `history.fallbackActor`) and merges
169
+ * any explicit `meta` overrides on top.
170
+ *
171
+ * @param args - `[...pathArgs, payload]` where `payload` is
172
+ * `{ title, description?, key?, display?, data?, meta? }`.
173
+ *
174
+ * @example
175
+ * ```ts
176
+ * await repos.pros.history!.recordCustom(proId, {
177
+ * key: "invoice_create_manually",
178
+ * title: "Création de la facture",
179
+ * description: "Facture #F-2026-042 créée manuellement",
180
+ * data: { invoiceId: "inv_123", amount: 150 },
181
+ * });
182
+ * ```
183
+ */
184
+ recordCustom(...args: [...PathArgs, HistoryCustomInput]): Promise<HistoryEntry<T> | null>;
162
185
  }
163
186
 
164
187
  export { createHistoryMethods as c };
@@ -1,5 +1,5 @@
1
1
  import { DocumentReference } from 'firebase-admin/firestore';
2
- import { a as HistoryListOptions, b as HistoryEntry, c as HistoryRawListOptions, V as V1HistoryDoc, d as V2HistoryDoc, e as HistoryOperation, f as HistoryMeta, g as HistoryConfigForModel } from './types--RamYGF1.cjs';
2
+ import { a as HistoryListOptions, b as HistoryEntry, c as HistoryRawListOptions, V as V1HistoryDoc, d as V2HistoryDoc, e as HistoryOperation, f as HistoryMeta, g as HistoryCustomData, h as HistoryCustomInput, i as HistoryConfigForModel } from './types-D6zvWzRt.cjs';
3
3
 
4
4
  /**
5
5
  * `repo.history.*` read API.
@@ -124,11 +124,11 @@ interface HistoryMethods<T, PathArgs extends readonly unknown[] = [string]> {
124
124
  * Convenience wrapper around {@link list} filtering on the operation type.
125
125
  *
126
126
  * @param args - `[...pathArgs, operation, options?]` where `operation` is
127
- * `"create" | "update" | "delete"`.
127
+ * `"create" | "update" | "delete" | "custom"`.
128
128
  *
129
129
  * @example
130
130
  * ```ts
131
- * await repos.residences.history!.byOperation("residence_123", "delete");
131
+ * await repos.residences.history!.byOperation("residence_123", "custom");
132
132
  * ```
133
133
  */
134
134
  byOperation(...args: [...PathArgs, HistoryOperation, HistoryListOptions<T>?]): Promise<HistoryEntry<T>[]>;
@@ -138,17 +138,17 @@ interface HistoryMethods<T, PathArgs extends readonly unknown[] = [string]> {
138
138
  * Useful when:
139
139
  * - You already have richer business context than the trigger can extract
140
140
  * (e.g. inside an HTTP handler that knows the authenticated user).
141
- * - You want to record an event that isn't a Firestore write (e.g.
142
- * `meta.reason = "exported-to-pdf"`).
141
+ * - You want to record a diff manually alongside explicit `meta` or `custom`.
143
142
  *
144
143
  * Honours the same `include` / `exclude` / meta auto-exclusion rules as
145
- * the trigger. Returns `null` when the diff is empty (no changes recorded).
144
+ * the trigger. Returns `null` when `operation === "update"` and the diff is
145
+ * empty (no changes recorded).
146
146
  *
147
147
  * > ⚠️ Use sparingly — combining manual records with the trigger can
148
148
  * > produce duplicate entries if both fire for the same write.
149
149
  *
150
150
  * @param args - `[...pathArgs, payload]` where `payload` is
151
- * `{ operation, before?, after?, meta? }`.
151
+ * `{ operation, before?, after?, meta?, custom? }`.
152
152
  */
153
153
  recordManual(...args: [
154
154
  ...PathArgs,
@@ -157,8 +157,31 @@ interface HistoryMethods<T, PathArgs extends readonly unknown[] = [string]> {
157
157
  before?: T | null;
158
158
  after?: T | null;
159
159
  meta?: HistoryMeta;
160
+ custom?: HistoryCustomData;
160
161
  }
161
162
  ]): Promise<HistoryEntry<T> | null>;
163
+ /**
164
+ * Record a custom business action (`operation: "custom"`) independent of
165
+ * model fields (e.g. manual invoice creation, PDF export, email sent).
166
+ *
167
+ * Automatically resolves the current actor from `AsyncLocalStorage` (Hono
168
+ * request / `withActor`, falling back to `history.fallbackActor`) and merges
169
+ * any explicit `meta` overrides on top.
170
+ *
171
+ * @param args - `[...pathArgs, payload]` where `payload` is
172
+ * `{ title, description?, key?, display?, data?, meta? }`.
173
+ *
174
+ * @example
175
+ * ```ts
176
+ * await repos.pros.history!.recordCustom(proId, {
177
+ * key: "invoice_create_manually",
178
+ * title: "Création de la facture",
179
+ * description: "Facture #F-2026-042 créée manuellement",
180
+ * data: { invoiceId: "inv_123", amount: 150 },
181
+ * });
182
+ * ```
183
+ */
184
+ recordCustom(...args: [...PathArgs, HistoryCustomInput]): Promise<HistoryEntry<T> | null>;
162
185
  }
163
186
 
164
187
  export { createHistoryMethods as c };
@@ -1,5 +1,5 @@
1
1
  import { b as AuthUser } from './firebase-auth-nG3prKoj.js';
2
- import { D as DeepDiffReturn, k as RulesMap, f as CrudUpdateRuleContext } from './types-DmXW_fVz.js';
2
+ import { D as DeepDiffReturn, k as RulesMap, f as CrudUpdateRuleContext } from './types-Cc6lelk1.js';
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 { b as AuthUser } from './firebase-auth-nG3prKoj.cjs';
2
- import { D as DeepDiffReturn, k as RulesMap, f as CrudUpdateRuleContext } from './types-CNseHqF7.cjs';
2
+ import { D as DeepDiffReturn, k as RulesMap, f as CrudUpdateRuleContext } from './types-BGh5_2fl.cjs';
3
3
 
4
4
  /**
5
5
  * Computes a typed diff between the existing document (`before`) and the incoming partial changes (`changesInput`).