@lpdjs/firestore-repo-service 3.0.17 → 3.0.19

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 (49) hide show
  1. package/dist/{actor-context-DQZgWqj3.d.cts → actor-context-zNobm6nG.d.cts} +17 -2
  2. package/dist/{actor-context-DQZgWqj3.d.ts → actor-context-zNobm6nG.d.ts} +17 -2
  3. package/dist/{create-servers-DKg5Yg2d.d.cts → create-servers-DydjOOOS.d.cts} +3 -3
  4. package/dist/{create-servers-BQ7pxnG0.d.ts → create-servers-bMJVVjPj.d.ts} +3 -3
  5. package/dist/{effects-B8aIXMZ2.d.ts → effects-BYvL8JUK.d.ts} +1 -1
  6. package/dist/{effects-CqJSneNZ.d.cts → effects-DcM19dy4.d.cts} +1 -1
  7. package/dist/history/index.cjs +1 -1
  8. package/dist/history/index.cjs.map +1 -1
  9. package/dist/history/index.d.cts +1 -1
  10. package/dist/history/index.d.ts +1 -1
  11. package/dist/history/index.js +1 -1
  12. package/dist/history/index.js.map +1 -1
  13. package/dist/index.cjs +55 -55
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +6 -6
  16. package/dist/index.d.ts +6 -6
  17. package/dist/index.js +55 -55
  18. package/dist/index.js.map +1 -1
  19. package/dist/llms-full.txt +30 -1
  20. package/dist/llms.txt +1 -1
  21. package/dist/servers/admin/index.d.cts +3 -3
  22. package/dist/servers/admin/index.d.ts +3 -3
  23. package/dist/servers/crud/index.cjs +2 -2
  24. package/dist/servers/crud/index.cjs.map +1 -1
  25. package/dist/servers/crud/index.d.cts +6 -6
  26. package/dist/servers/crud/index.d.ts +6 -6
  27. package/dist/servers/crud/index.js +2 -2
  28. package/dist/servers/crud/index.js.map +1 -1
  29. package/dist/servers/hono/index.cjs +12 -12
  30. package/dist/servers/hono/index.cjs.map +1 -1
  31. package/dist/servers/hono/index.d.cts +4 -4
  32. package/dist/servers/hono/index.d.ts +4 -4
  33. package/dist/servers/hono/index.js +12 -12
  34. package/dist/servers/hono/index.js.map +1 -1
  35. package/dist/servers/index.cjs +63 -63
  36. package/dist/servers/index.cjs.map +1 -1
  37. package/dist/servers/index.d.cts +6 -6
  38. package/dist/servers/index.d.ts +6 -6
  39. package/dist/servers/index.js +63 -63
  40. package/dist/servers/index.js.map +1 -1
  41. package/dist/sync/index.cjs +54 -54
  42. package/dist/sync/index.cjs.map +1 -1
  43. package/dist/sync/index.js +54 -54
  44. package/dist/sync/index.js.map +1 -1
  45. package/dist/{types-wMBgnYjH.d.ts → types-5Q7JDDba.d.ts} +52 -3
  46. package/dist/{types-w1rEqs0Z.d.ts → types-BJ6MAavL.d.ts} +1 -1
  47. package/dist/{types-DgzPoPvx.d.cts → types-BYPdlGSL.d.cts} +52 -3
  48. package/dist/{types-BDTx8VPg.d.cts → types-XvVG8_9J.d.cts} +1 -1
  49. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { b as AuthUser } from './firebase-auth-nG3prKoj.js';
2
- import { H as HonoServerOptions, O as OpenAPIConfig } from './types-w1rEqs0Z.js';
2
+ import { H as HonoServerOptions, O as OpenAPIConfig } from './types-BJ6MAavL.js';
3
3
  import { z } from 'zod';
4
4
  import { Context } from 'hono';
5
5
  import { HttpsOptions } from 'firebase-functions/v2/https';
@@ -563,6 +563,36 @@ interface SecurityHeadersOptions {
563
563
  */
564
564
  declare function securityHeaders(opts?: SecurityHeadersOptions): (_req: AnyReq, res: AnyRes, next: Next) => Promise<void>;
565
565
 
566
+ /**
567
+ * Descriptor for an extra custom HTTP header parameter emitted in OpenAPI 3.1
568
+ * (e.g. a custom header read by `actorResolver.extras`).
569
+ */
570
+ interface OpenAPIHeaderParamSpec {
571
+ /** HTTP header name (e.g. `"X-App-Source"`). */
572
+ name: string;
573
+ /** Optional description displayed in Scalar / OpenAPI docs. */
574
+ description?: string;
575
+ /** Whether the header is required (default: `false`). */
576
+ required?: boolean;
577
+ /** Optional JSON Schema for the header value (default: `{ type: "string" }`). */
578
+ schema?: Record<string, unknown>;
579
+ }
580
+ /**
581
+ * Configuration controlling which history audit headers (`in: "header"`) are
582
+ * emitted on write endpoints (`POST`, `PUT`, `PATCH`, `POST /batch`) for
583
+ * repositories with active shadow history (`history.enabled: true`).
584
+ */
585
+ interface OpenAPIHistoryHeadersConfig {
586
+ /** Header name for change reason, or `false` to omit. Default: auto-detected from `actorResolver` (`"X-History-Reason"`). */
587
+ reasonHeader?: string | false;
588
+ /** Header name for change comment, or `false` to omit. Default: auto-detected from `actorResolver` (`"X-History-Comment"`). */
589
+ commentHeader?: string | false;
590
+ /**
591
+ * Optional extra headers (string shorthand or full descriptor) to emit alongside
592
+ * history headers on history-enabled write endpoints (e.g. headers read by `actorResolver.extras`).
593
+ */
594
+ extraHeaders?: Array<string | OpenAPIHeaderParamSpec>;
595
+ }
566
596
  /**
567
597
  * Options to control OpenAPI 3.1 spec generation for the CRUD server.
568
598
  * Defined here (rather than in `./openapi`) to avoid a circular import:
@@ -588,6 +618,16 @@ interface OpenAPISpecOptions {
588
618
  docsPath?: string | false;
589
619
  /** Auth guards for the docs UI (same as HonoServer DocsAuthExtension or middleware) */
590
620
  docsAuth?: OpenAPIConfig["docsAuth"];
621
+ /**
622
+ * Control automatic emission of history audit header parameters (`X-History-Reason`,
623
+ * `X-History-Comment`, or custom names from `actorResolver`) on write operations
624
+ * (`POST`, `PUT`, `PATCH`, `POST /batch`) for repositories with active shadow history.
625
+ *
626
+ * - Omitted: auto-detected from `actorResolver`.
627
+ * - `false`: disable emitting history headers in the OpenAPI spec.
628
+ * - Object: override `reasonHeader` / `commentHeader` and/or declare `extraHeaders`.
629
+ */
630
+ historyHeaders?: false | OpenAPIHistoryHeadersConfig;
591
631
  }
592
632
  /**
593
633
  * Extracts the model type `T` from a `ConfiguredRepository`.
@@ -1125,6 +1165,15 @@ interface CrudRepoEntry {
1125
1165
  rules?: AnyCrudRules;
1126
1166
  /** Post-write lifecycle hooks (see {@link CrudHooks}). */
1127
1167
  hooks?: AnyCrudHooks;
1168
+ /**
1169
+ * Active history shadow header flags (auto-detected when `history.enabled`
1170
+ * is true, `autoInjectMeta !== false`, and shadow storage is active).
1171
+ * Used by OpenAPI generation to emit optional audit headers on write endpoints.
1172
+ */
1173
+ historyHeaders?: {
1174
+ reason: boolean;
1175
+ comment: boolean;
1176
+ };
1128
1177
  }
1129
1178
  type CrudRepoRegistry = Record<string, CrudRepoEntry>;
1130
1179
  /**
@@ -1360,5 +1409,5 @@ interface QueryRequestBody {
1360
1409
  withTotal?: boolean;
1361
1410
  }
1362
1411
 
1363
- export { DEFAULT_HTML_CSP as a0, securityHeaders as a1, createPaginationIterator as ad, executePaginatedQuery as ae };
1364
- export type { QueryError as $, AnyCrudHooks as A, MutationRule as B, ConfiguredRepository as C, DeepDiffReturn as D, EffectExecutionResult as E, FieldRole as F, MutationsMap as G, PreWriteMutationFn as H, IndexErrorCallback as I, RepoRelationKeys as J, Rule as K, ListResponseData as L, MutationContext as M, RuleEffect as N, OpenAPISpecOptions as O, PreWriteMutation as P, QueryRequestBody as Q, RepoFieldPath as R, RuleResult as S, RulesMap as T, UserFieldPath as U, RelationalFieldMeta as V, SecurityHeadersOptions as W, PageOptions as X, ColumnMeta as Y, FilterState as Z, SortState as _, CrudServerOptions as a, PaginationOptions as a2, GenerateGetMethods as a3, GenerateQueryMethods as a4, IncludeConfigTyped as a5, PaginationResult as a6, PaginationWithIncludeOptionsTyped as a7, PopulateOptionsTyped as a8, SystemBackfillFailure as a9, SystemBackfillOptions as aa, SystemBackfillResult as ab, UpdatableData as ac, ApiResponse as b, ApplyEffectsResult as c, CrudAfterBatchContext as d, CrudAfterBatchCreatedItem as e, CrudAfterBatchDeletedItem as f, CrudAfterBatchUpdatedItem as g, CrudAfterCreateContext as h, CrudAfterDeleteContext as i, CrudAfterUpdateContext as j, CrudBeforeCreateContext as k, CrudBeforeUpdateContext as l, CrudEffectOperation as m, CrudHookErrorCallback as n, CrudHookErrorContext as o, CrudHookName as p, CrudHooks as q, CrudRepoConfig as r, CrudRepoEntry as s, CrudRepoRegistry as t, CrudRules as u, CrudUpdateRuleContext as v, CrudWriteOperation as w, EffectPredicateArgs as x, EffectsMap as y, IndexErrorContext as z };
1412
+ export { DEFAULT_HTML_CSP as a2, securityHeaders as a3, createPaginationIterator as af, executePaginatedQuery as ag };
1413
+ export type { FilterState as $, AnyCrudHooks as A, MutationRule as B, ConfiguredRepository as C, DeepDiffReturn as D, EffectExecutionResult as E, FieldRole as F, MutationsMap as G, OpenAPIHistoryHeadersConfig as H, IndexErrorCallback as I, OpenAPISpecOptions as J, PreWriteMutationFn as K, ListResponseData as L, MutationContext as M, RepoRelationKeys as N, OpenAPIHeaderParamSpec as O, PreWriteMutation as P, QueryRequestBody as Q, RepoFieldPath as R, Rule as S, RuleEffect as T, RuleResult as U, RulesMap as V, UserFieldPath as W, RelationalFieldMeta as X, SecurityHeadersOptions as Y, PageOptions as Z, ColumnMeta as _, CrudServerOptions as a, SortState as a0, QueryError as a1, PaginationOptions as a4, GenerateGetMethods as a5, GenerateQueryMethods as a6, IncludeConfigTyped as a7, PaginationResult as a8, PaginationWithIncludeOptionsTyped as a9, PopulateOptionsTyped as aa, SystemBackfillFailure as ab, SystemBackfillOptions as ac, SystemBackfillResult as ad, UpdatableData as ae, ApiResponse as b, ApplyEffectsResult as c, CrudAfterBatchContext as d, CrudAfterBatchCreatedItem as e, CrudAfterBatchDeletedItem as f, CrudAfterBatchUpdatedItem as g, CrudAfterCreateContext as h, CrudAfterDeleteContext as i, CrudAfterUpdateContext as j, CrudBeforeCreateContext as k, CrudBeforeUpdateContext as l, CrudEffectOperation as m, CrudHookErrorCallback as n, CrudHookErrorContext as o, CrudHookName as p, CrudHooks as q, CrudRepoConfig as r, CrudRepoEntry as s, CrudRepoRegistry as t, CrudRules as u, CrudUpdateRuleContext as v, CrudWriteOperation as w, EffectPredicateArgs as x, EffectsMap as y, IndexErrorContext as z };
@@ -1,7 +1,7 @@
1
1
  import { z, ZodError } from 'zod';
2
2
  import { Env, Context, MiddlewareHandler } from 'hono';
3
3
  import { F as FirebaseAdminAuthLike, D as DecodedIdTokenLike } from './firebase-auth-nG3prKoj.js';
4
- import { A as ActorResolverOption } from './actor-context-DQZgWqj3.js';
4
+ import { A as ActorResolverOption } from './actor-context-zNobm6nG.js';
5
5
 
6
6
  /**
7
7
  * Global DI services container for the Hono server.
@@ -1,5 +1,5 @@
1
1
  import { b as AuthUser } from './firebase-auth-nG3prKoj.cjs';
2
- import { H as HonoServerOptions, O as OpenAPIConfig } from './types-BDTx8VPg.cjs';
2
+ import { H as HonoServerOptions, O as OpenAPIConfig } from './types-XvVG8_9J.cjs';
3
3
  import { z } from 'zod';
4
4
  import { Context } from 'hono';
5
5
  import { HttpsOptions } from 'firebase-functions/v2/https';
@@ -563,6 +563,36 @@ interface SecurityHeadersOptions {
563
563
  */
564
564
  declare function securityHeaders(opts?: SecurityHeadersOptions): (_req: AnyReq, res: AnyRes, next: Next) => Promise<void>;
565
565
 
566
+ /**
567
+ * Descriptor for an extra custom HTTP header parameter emitted in OpenAPI 3.1
568
+ * (e.g. a custom header read by `actorResolver.extras`).
569
+ */
570
+ interface OpenAPIHeaderParamSpec {
571
+ /** HTTP header name (e.g. `"X-App-Source"`). */
572
+ name: string;
573
+ /** Optional description displayed in Scalar / OpenAPI docs. */
574
+ description?: string;
575
+ /** Whether the header is required (default: `false`). */
576
+ required?: boolean;
577
+ /** Optional JSON Schema for the header value (default: `{ type: "string" }`). */
578
+ schema?: Record<string, unknown>;
579
+ }
580
+ /**
581
+ * Configuration controlling which history audit headers (`in: "header"`) are
582
+ * emitted on write endpoints (`POST`, `PUT`, `PATCH`, `POST /batch`) for
583
+ * repositories with active shadow history (`history.enabled: true`).
584
+ */
585
+ interface OpenAPIHistoryHeadersConfig {
586
+ /** Header name for change reason, or `false` to omit. Default: auto-detected from `actorResolver` (`"X-History-Reason"`). */
587
+ reasonHeader?: string | false;
588
+ /** Header name for change comment, or `false` to omit. Default: auto-detected from `actorResolver` (`"X-History-Comment"`). */
589
+ commentHeader?: string | false;
590
+ /**
591
+ * Optional extra headers (string shorthand or full descriptor) to emit alongside
592
+ * history headers on history-enabled write endpoints (e.g. headers read by `actorResolver.extras`).
593
+ */
594
+ extraHeaders?: Array<string | OpenAPIHeaderParamSpec>;
595
+ }
566
596
  /**
567
597
  * Options to control OpenAPI 3.1 spec generation for the CRUD server.
568
598
  * Defined here (rather than in `./openapi`) to avoid a circular import:
@@ -588,6 +618,16 @@ interface OpenAPISpecOptions {
588
618
  docsPath?: string | false;
589
619
  /** Auth guards for the docs UI (same as HonoServer DocsAuthExtension or middleware) */
590
620
  docsAuth?: OpenAPIConfig["docsAuth"];
621
+ /**
622
+ * Control automatic emission of history audit header parameters (`X-History-Reason`,
623
+ * `X-History-Comment`, or custom names from `actorResolver`) on write operations
624
+ * (`POST`, `PUT`, `PATCH`, `POST /batch`) for repositories with active shadow history.
625
+ *
626
+ * - Omitted: auto-detected from `actorResolver`.
627
+ * - `false`: disable emitting history headers in the OpenAPI spec.
628
+ * - Object: override `reasonHeader` / `commentHeader` and/or declare `extraHeaders`.
629
+ */
630
+ historyHeaders?: false | OpenAPIHistoryHeadersConfig;
591
631
  }
592
632
  /**
593
633
  * Extracts the model type `T` from a `ConfiguredRepository`.
@@ -1125,6 +1165,15 @@ interface CrudRepoEntry {
1125
1165
  rules?: AnyCrudRules;
1126
1166
  /** Post-write lifecycle hooks (see {@link CrudHooks}). */
1127
1167
  hooks?: AnyCrudHooks;
1168
+ /**
1169
+ * Active history shadow header flags (auto-detected when `history.enabled`
1170
+ * is true, `autoInjectMeta !== false`, and shadow storage is active).
1171
+ * Used by OpenAPI generation to emit optional audit headers on write endpoints.
1172
+ */
1173
+ historyHeaders?: {
1174
+ reason: boolean;
1175
+ comment: boolean;
1176
+ };
1128
1177
  }
1129
1178
  type CrudRepoRegistry = Record<string, CrudRepoEntry>;
1130
1179
  /**
@@ -1360,5 +1409,5 @@ interface QueryRequestBody {
1360
1409
  withTotal?: boolean;
1361
1410
  }
1362
1411
 
1363
- export { DEFAULT_HTML_CSP as a0, securityHeaders as a1, createPaginationIterator as ad, executePaginatedQuery as ae };
1364
- export type { QueryError as $, AnyCrudHooks as A, MutationRule as B, ConfiguredRepository as C, DeepDiffReturn as D, EffectExecutionResult as E, FieldRole as F, MutationsMap as G, PreWriteMutationFn as H, IndexErrorCallback as I, RepoRelationKeys as J, Rule as K, ListResponseData as L, MutationContext as M, RuleEffect as N, OpenAPISpecOptions as O, PreWriteMutation as P, QueryRequestBody as Q, RepoFieldPath as R, RuleResult as S, RulesMap as T, UserFieldPath as U, RelationalFieldMeta as V, SecurityHeadersOptions as W, PageOptions as X, ColumnMeta as Y, FilterState as Z, SortState as _, CrudServerOptions as a, PaginationOptions as a2, GenerateGetMethods as a3, GenerateQueryMethods as a4, IncludeConfigTyped as a5, PaginationResult as a6, PaginationWithIncludeOptionsTyped as a7, PopulateOptionsTyped as a8, SystemBackfillFailure as a9, SystemBackfillOptions as aa, SystemBackfillResult as ab, UpdatableData as ac, ApiResponse as b, ApplyEffectsResult as c, CrudAfterBatchContext as d, CrudAfterBatchCreatedItem as e, CrudAfterBatchDeletedItem as f, CrudAfterBatchUpdatedItem as g, CrudAfterCreateContext as h, CrudAfterDeleteContext as i, CrudAfterUpdateContext as j, CrudBeforeCreateContext as k, CrudBeforeUpdateContext as l, CrudEffectOperation as m, CrudHookErrorCallback as n, CrudHookErrorContext as o, CrudHookName as p, CrudHooks as q, CrudRepoConfig as r, CrudRepoEntry as s, CrudRepoRegistry as t, CrudRules as u, CrudUpdateRuleContext as v, CrudWriteOperation as w, EffectPredicateArgs as x, EffectsMap as y, IndexErrorContext as z };
1412
+ export { DEFAULT_HTML_CSP as a2, securityHeaders as a3, createPaginationIterator as af, executePaginatedQuery as ag };
1413
+ export type { FilterState as $, AnyCrudHooks as A, MutationRule as B, ConfiguredRepository as C, DeepDiffReturn as D, EffectExecutionResult as E, FieldRole as F, MutationsMap as G, OpenAPIHistoryHeadersConfig as H, IndexErrorCallback as I, OpenAPISpecOptions as J, PreWriteMutationFn as K, ListResponseData as L, MutationContext as M, RepoRelationKeys as N, OpenAPIHeaderParamSpec as O, PreWriteMutation as P, QueryRequestBody as Q, RepoFieldPath as R, Rule as S, RuleEffect as T, RuleResult as U, RulesMap as V, UserFieldPath as W, RelationalFieldMeta as X, SecurityHeadersOptions as Y, PageOptions as Z, ColumnMeta as _, CrudServerOptions as a, SortState as a0, QueryError as a1, PaginationOptions as a4, GenerateGetMethods as a5, GenerateQueryMethods as a6, IncludeConfigTyped as a7, PaginationResult as a8, PaginationWithIncludeOptionsTyped as a9, PopulateOptionsTyped as aa, SystemBackfillFailure as ab, SystemBackfillOptions as ac, SystemBackfillResult as ad, UpdatableData as ae, ApiResponse as b, ApplyEffectsResult as c, CrudAfterBatchContext as d, CrudAfterBatchCreatedItem as e, CrudAfterBatchDeletedItem as f, CrudAfterBatchUpdatedItem as g, CrudAfterCreateContext as h, CrudAfterDeleteContext as i, CrudAfterUpdateContext as j, CrudBeforeCreateContext as k, CrudBeforeUpdateContext as l, CrudEffectOperation as m, CrudHookErrorCallback as n, CrudHookErrorContext as o, CrudHookName as p, CrudHooks as q, CrudRepoConfig as r, CrudRepoEntry as s, CrudRepoRegistry as t, CrudRules as u, CrudUpdateRuleContext as v, CrudWriteOperation as w, EffectPredicateArgs as x, EffectsMap as y, IndexErrorContext as z };
@@ -1,7 +1,7 @@
1
1
  import { z, ZodError } from 'zod';
2
2
  import { Env, Context, MiddlewareHandler } from 'hono';
3
3
  import { F as FirebaseAdminAuthLike, D as DecodedIdTokenLike } from './firebase-auth-nG3prKoj.cjs';
4
- import { A as ActorResolverOption } from './actor-context-DQZgWqj3.cjs';
4
+ import { A as ActorResolverOption } from './actor-context-zNobm6nG.cjs';
5
5
 
6
6
  /**
7
7
  * Global DI services container for the Hono server.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lpdjs/firestore-repo-service",
3
- "version": "3.0.17",
3
+ "version": "3.0.19",
4
4
  "workspaces": [
5
5
  "test/functions"
6
6
  ],