@classytic/mongokit 3.43.1 → 3.45.0

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 (92) hide show
  1. package/README.md +18 -3
  2. package/dist/{PaginationEngine-DZnkbSrr.mjs → PaginationEngine-BRlLTQQz.mjs} +13 -27
  3. package/dist/{PaginationEngine-CRHyuUtw.d.mts → PaginationEngine-BWb-c47a.d.mts} +1 -3
  4. package/dist/{Repository-DnL4xk5w.d.mts → Repository-DJuRmBNx.d.mts} +44 -13
  5. package/dist/{Repository-Dj6xqPxJ.mjs → Repository-DheA7oW-.mjs} +330 -112
  6. package/dist/actions/index.d.mts +1 -1
  7. package/dist/actions/index.mjs +2 -2
  8. package/dist/{actions-ChYfkPYP.mjs → actions-DKQx9ToJ.mjs} +3 -4
  9. package/dist/adapter/index.d.mts +6 -10
  10. package/dist/adapter/index.mjs +1 -1
  11. package/dist/{adapter-CkMoMF83.mjs → adapter-Qzgc3ZD_.mjs} +4 -6
  12. package/dist/ai/index.d.mts +21 -8
  13. package/dist/ai/index.mjs +15 -9
  14. package/dist/better-auth/index.d.mts +21 -20
  15. package/dist/better-auth/index.mjs +12 -23
  16. package/dist/{coercion-BjdPX3YF.d.mts → coercion-COp9DRNw.d.mts} +0 -2
  17. package/dist/{create-repository-UjwPWR1z.mjs → create-repository-C9DHHcl7.mjs} +4 -5
  18. package/dist/{create-repository-CJtVdwig.d.mts → create-repository-DG-gwOf0.d.mts} +5 -7
  19. package/dist/{derive-DRBiegRH.mjs → derive-Dxsc31fV.mjs} +3 -6
  20. package/dist/{error-BuByZwKU.mjs → error-DjdmPLWO.mjs} +1 -2
  21. package/dist/{field-selection-FSQFLpsU.mjs → field-selection-DPFaFw9Y.mjs} +1 -2
  22. package/dist/{id-chunks-BmAwsqNk.mjs → id-chunks-DH-RAZWG.mjs} +13 -8
  23. package/dist/{id-resolution-BqDrk0S2.mjs → id-resolution-Cqh49d9J.mjs} +1 -2
  24. package/dist/idempotency/index.d.mts +4 -7
  25. package/dist/idempotency/index.mjs +1 -2
  26. package/dist/{index-SYF8N28D.d.mts → index-5mhQ63_B.d.mts} +3 -4
  27. package/dist/{index-C0AjVqX3.d.mts → index-ehGZLbrd.d.mts} +2 -8
  28. package/dist/index.d.mts +70 -102
  29. package/dist/index.mjs +36 -52
  30. package/dist/indexes/verify-indexes.d.mts +8 -11
  31. package/dist/indexes/verify-indexes.mjs +1 -2
  32. package/dist/{indexes-DIjMpYES.d.mts → indexes-FfyOuhDK.d.mts} +0 -2
  33. package/dist/{join-scope-DSAznE8E.mjs → join-scope-C1gOtZ59.mjs} +2 -3
  34. package/dist/kernel-conformance/index.d.mts +39 -13
  35. package/dist/kernel-conformance/index.mjs +4 -7
  36. package/dist/lock/index.d.mts +134 -7
  37. package/dist/lock/index.mjs +349 -14
  38. package/dist/{logger-K7dPmu2U.mjs → logger-hbWOlj_X.mjs} +1 -2
  39. package/dist/{method-registry.plugin-C63pGn1d.mjs → method-registry.plugin-BeJfQBJV.mjs} +5 -7
  40. package/dist/{model-registry-ClKtWiHa.mjs → model-registry-DrVfJ3Nt.mjs} +1 -2
  41. package/dist/{mongooseToJsonSchema-C3k4ide0.mjs → mongooseToJsonSchema-DMDotz4_.mjs} +2 -3
  42. package/dist/{multi-tenant.plugin-B_q9NUHc.d.mts → multi-tenant.plugin-BTPtCLNK.d.mts} +143 -11
  43. package/dist/{operations-XiFgG5US.d.mts → operations-D6XsHx4e.d.mts} +19 -11
  44. package/dist/outbox/index.d.mts +24 -9
  45. package/dist/outbox/index.mjs +17 -6
  46. package/dist/pagination/PaginationEngine.d.mts +1 -1
  47. package/dist/pagination/PaginationEngine.mjs +1 -1
  48. package/dist/pagination/utils/limits.d.mts +6 -9
  49. package/dist/pagination/utils/limits.mjs +2 -3
  50. package/dist/{pagination-D6psses0.d.mts → pagination-BAM9cA4N.d.mts} +6 -16
  51. package/dist/{plugin-options-Cirmb4Kp.d.mts → plugin-options-DrNGWV5b.d.mts} +2 -4
  52. package/dist/plugins/index.d.mts +6 -7
  53. package/dist/plugins/index.mjs +6 -7
  54. package/dist/query/primitives/coercion.d.mts +1 -1
  55. package/dist/query/primitives/coercion.mjs +2 -3
  56. package/dist/query/primitives/geo.d.mts +11 -14
  57. package/dist/query/primitives/geo.mjs +1 -2
  58. package/dist/query/primitives/indexes.d.mts +1 -1
  59. package/dist/query/primitives/indexes.mjs +1 -2
  60. package/dist/{query-defaults-BxUcSOoF.mjs → query-defaults-DwvWUjZU.mjs} +18 -54
  61. package/dist/read-model/index.d.mts +18 -21
  62. package/dist/read-model/index.mjs +3 -4
  63. package/dist/{repository-MqAP409e.d.mts → repository-B0aFVgP2.d.mts} +25 -29
  64. package/dist/retention-purge-CCd_VXUf.d.mts +38 -0
  65. package/dist/{rolldown-runtime-D7D4PA-g.mjs → rolldown-runtime-D8jQpDG7.mjs} +1 -2
  66. package/dist/search/index.d.mts +1 -1
  67. package/dist/search/index.mjs +1 -1
  68. package/dist/sync/index.d.mts +113 -17
  69. package/dist/sync/index.mjs +421 -65
  70. package/dist/tenant/index.d.mts +8 -11
  71. package/dist/tenant/index.mjs +1 -2
  72. package/dist/testkit/index.d.mts +179 -23
  73. package/dist/testkit/index.mjs +421 -23
  74. package/dist/{timestamp.plugin-DpOWavVI.mjs → timestamp.plugin-B-IJrlYb.mjs} +192 -49
  75. package/dist/{to-plain-vksRrLtc.mjs → to-plain-CEKv_ylg.mjs} +2 -4
  76. package/dist/{to-plain-o5tUY2nV.d.mts → to-plain-Do-8jTKC.d.mts} +2 -16
  77. package/dist/{transaction-DmiB4k2P.mjs → transaction-C6Oj941P.mjs} +18 -19
  78. package/dist/{type-utils-CLzRFtIA.d.mts → type-utils-CKvuewAL.d.mts} +0 -2
  79. package/dist/{update-WgeAUJ_I.mjs → update-CYaJMu6j.mjs} +13 -23
  80. package/dist/usage/index.d.mts +2 -5
  81. package/dist/usage/index.mjs +8 -6
  82. package/dist/utils/index.d.mts +8 -10
  83. package/dist/utils/index.mjs +7 -7
  84. package/dist/{validation-chain.plugin-BAeC5eVT.d.mts → validation-chain.plugin-COYrUdd8.d.mts} +150 -48
  85. package/dist/{validation-chain.plugin-DRApTmkN.mjs → validation-chain.plugin-DJplVJ12.mjs} +210 -55
  86. package/llms.txt +33 -0
  87. package/package.json +29 -25
  88. package/skills/mongokit/SKILL.md +112 -0
  89. package/skills/mongokit/references/pagination-search.md +87 -0
  90. package/skills/mongokit/references/plugins-tenancy.md +103 -0
  91. package/skills/mongokit/references/repository-api.md +83 -0
  92. package/skills/mongokit/references/transactions-outbox.md +103 -0
@@ -1,6 +1,6 @@
1
- import { S as LookupOptions, c as DeleteResult, d as GroupResult, h as OperationOptions, l as FindOneAndUpdateOptions, m as MinMaxResult, o as CreateOptions, v as UpdateManyResult, y as UpdateOptions } from "./operations-XiFgG5US.mjs";
2
- import { A as ObjectId, D as AnyDocument, F as SortSpec, N as SelectSpec, j as PopulateSpec, y as ResolvedQueryOptions } from "./pagination-D6psses0.mjs";
3
- import { p as UpdateWithValidationResult } from "./type-utils-CLzRFtIA.mjs";
1
+ import { S as LookupOptions, c as DeleteResult, d as GroupResult, h as OperationOptions, l as FindOneAndUpdateOptions, m as MinMaxResult, o as CreateOptions, v as UpdateManyResult, y as UpdateOptions } from "./operations-D6XsHx4e.mjs";
2
+ import { A as ObjectId, D as AnyDocument, F as SortSpec, N as SelectSpec, j as PopulateSpec, y as ResolvedQueryOptions } from "./pagination-BAM9cA4N.mjs";
3
+ import { p as UpdateWithValidationResult } from "./type-utils-CKvuewAL.mjs";
4
4
  import { Model, PipelineStage } from "mongoose";
5
5
  declare namespace aggregate_d_exports {
6
6
  export { aggregate, aggregatePaginate, average, countBy, distinct, facet, groupBy, lookup, minMax, sum, unwind };
@@ -377,5 +377,4 @@ declare function pullFromArray<TDoc = AnyDocument>(Model: Model<TDoc>, id: strin
377
377
  declare namespace index_d_exports {
378
378
  export { aggregate_d_exports as aggregate, create_d_exports as create, delete_d_exports as deleteActions, read_d_exports as read, update_d_exports as update };
379
379
  }
380
- //#endregion
381
380
  export { CreateManyFailure as a, create_d_exports as c, delete_d_exports as i, isCreateManyPartialError as l, update_d_exports as n, CreateManyPartial as o, read_d_exports as r, CreateManyPartialError as s, index_d_exports as t, aggregate_d_exports as u };
@@ -1,4 +1,3 @@
1
- //#region src/search/derive.d.ts
2
1
  /**
3
2
  * How a write changes the search fields: the pure analysis behind the
4
3
  * search-keys plugin. Given one write (a document, a replacement, or an update
@@ -9,17 +8,15 @@
9
8
  /** Thrown (as `status: 400` with a `code`) for a write the keys cannot follow. */
10
9
  declare const SEARCH_KEYS_ERROR_CODES: {
11
10
  /** An operator or path the plugin cannot evaluate touches a search field. */
12
- readonly UNSUPPORTED_UPDATE: "SEARCH_KEYS_UNSUPPORTED_UPDATE";
11
+ readonly UNSUPPORTED_UPDATE: 'SEARCH_KEYS_UNSUPPORTED_UPDATE';
13
12
  /** A multi-document update sets SOME search fields; the rest differ per document. */
14
- readonly PARTIAL_MULTI_UPDATE: "SEARCH_KEYS_PARTIAL_MULTI_UPDATE";
13
+ readonly PARTIAL_MULTI_UPDATE: 'SEARCH_KEYS_PARTIAL_MULTI_UPDATE';
15
14
  };
16
15
  declare class SearchKeysWriteError extends Error {
17
16
  readonly code: (typeof SEARCH_KEYS_ERROR_CODES)[keyof typeof SEARCH_KEYS_ERROR_CODES];
18
17
  readonly status = 400;
19
18
  constructor(message: string, code: (typeof SEARCH_KEYS_ERROR_CODES)[keyof typeof SEARCH_KEYS_ERROR_CODES]);
20
19
  }
21
- //#endregion
22
- //#region src/search/normalize.d.ts
23
20
  /**
24
21
  * Search-as-you-type text rules, shared by the WRITER (the search keys stored on
25
22
  * every document) and the READER (the query typed into a search box).
@@ -76,8 +73,6 @@ interface SearchMatchRange {
76
73
  * // [{ start: 0, end: 3 }, { start: 12, end: 15 }]
77
74
  */
78
75
  declare function findSearchMatches(text: string, query: string): SearchMatchRange[];
79
- //#endregion
80
- //#region src/search/prefix.d.ts
81
76
  /**
82
77
  * Indexed search-as-you-type (`searchMode: 'prefix'`): the stored keys, the
83
78
  * query filter, and the index/schema declarations. Pure: no mongoose import.
@@ -165,5 +160,4 @@ declare function searchKeysIndex(field?: string, options?: {
165
160
  name: string;
166
161
  };
167
162
  };
168
- //#endregion
169
163
  export { prefixSearchFilter as a, SearchMatchRange as c, tokenizeSearchText as d, SEARCH_KEYS_ERROR_CODES as f, buildSearchKeys as i, findSearchMatches as l, MAX_PREFIX_SEARCH_TERMS as n, searchKeysIndex as o, SearchKeysWriteError as p, PrefixSearchFilterOptions as r, searchKeysPath as s, DEFAULT_SEARCH_KEYS_FIELD as t, normalizeSearchText as u };
package/dist/index.d.mts CHANGED
@@ -1,24 +1,24 @@
1
- import { S as LookupOptions, _ as SessionOptions, a as ConvenientTransactionOptions, b as WithTransactionOptions, c as DeleteResult, d as GroupResult, f as LookupPopulateOptions, g as ReadOptions, h as OperationOptions, i as CacheableOptions, l as FindOneAndUpdateOptions, m as MinMaxResult, n as AggregateOptions, o as CreateOptions, p as LookupPopulateResult, r as CacheOperationOptions, t as AggregateCallOptions, u as GetByIdsOptions, v as UpdateManyResult, x as LookupBuilder, y as UpdateOptions } from "./operations-XiFgG5US.mjs";
2
- import { A as ObjectId, C as configureQueryDefaults, D as AnyDocument, E as resolveQueryOptions, F as SortSpec$1, M as ReadPreferenceType, N as SelectSpec, O as AnyModel, P as SortDirection, S as configureAggregateDefaults, T as resetQueryDefaults, _ as QueryDefaults, a as CursorPayload, b as WriteConcernSpec, c as MongokitPageExtras, d as ValueType, f as CursorSecret, g as QUERY_DEFAULTS_ERROR_CODES, h as PerCallQueryOptions, i as CountStrategy, j as PopulateSpec, l as OffsetPaginationOptions, m as CommandKind, n as BasePaginationOptions, o as DecodedCursor, p as AggregateDefaults, r as CollationOptions, s as KeysetPaginationOptions, t as AggregatePaginationOptions, u as PaginationConfig, v as ReadConcernLevel, w as getQueryDefaults, x as assertQueryDefaultsConfigured, y as ResolvedQueryOptions } from "./pagination-D6psses0.mjs";
3
- import { a as CreateManyFailure, l as isCreateManyPartialError, o as CreateManyPartial, s as CreateManyPartialError, t as index_d_exports } from "./index-SYF8N28D.mjs";
4
- import { a as InferRawDoc, c as NonNullableFields, d as Strict, f as UpdatePatch, i as InferDocument, l as PartialBy, n as DeepPartial, o as KeysOfType, p as UpdateWithValidationResult, r as DocField, s as MongoOperatorUpdate, t as CreateInput, u as RequiredBy } from "./type-utils-CLzRFtIA.mjs";
5
- import { C as RepositoryPluginName, S as MongoKitPluginName, _ as RepositoryOptions, a as HookMode, b as WithPlugins, c as MinimalRepoView, d as PluginType, f as PrioritizedHook, g as RepositoryOperation, h as RepositoryInstance, i as EventPhase, l as Plugin, m as RepositoryEvent, n as EventHandlers, o as Middleware, p as RepositoryContext, r as EventPayload, s as MiddlewareContext, t as AllPluginMethods, u as PluginFunction, v as RepositorySearchMode, x as MONGOKIT_PLUGIN_NAMES, y as UserContext } from "./repository-MqAP409e.mjs";
6
- import { A as EnsureAuditTrailReadyOptions, C as AuditQueryOptions, D as AuditTrailOptions, E as AuditTrailMode, M as ensureAuditTrailReady, O as AuditTrailQuery, S as AuditOperation, T as AuditTrailMethods, _ as CacheOptions, a as DateSequentialIdOptions, b as cachePlugin, c as SequentialIdOptions, d as ensureSequenceAtLeast, f as getNextSequence, g as CacheAdapter, h as sequentialId, i as CustomIdOptions, j as auditTrailPlugin, k as AuditTrailQueryOptions, l as customIdPlugin, m as readSequence, n as adminBypass, o as IdGenerator, p as prefixedId, r as multiTenantPlugin, s as PrefixedIdOptions, t as MultiTenantOptions, u as dateSequentialId, v as RepositoryCacheHandle, w as AuditQueryResult, x as AuditEntry, y as RepositoryCachePluginOptions } from "./multi-tenant.plugin-B_q9NUHc.mjs";
7
- import { n as PaginationEngine, t as CountMemoKey } from "./PaginationEngine-CRHyuUtw.mjs";
8
- import { a as AggregationBuilder, c as ProjectionSpec, d as VectorSearchOptions, i as TransitionMachine, l as SortOrder, n as HOOK_PRIORITY, o as AggregationPlan, r as Repository, s as GroupSpec, t as GetAllParams, u as SortSpec } from "./Repository-DnL4xk5w.mjs";
9
- import { a as SoftDeleteFilterMode, c as ValidationChainOptions, i as Logger, l as ValidatorDefinition, n as CascadeRelation, o as SoftDeleteOptions, r as FieldPreset, s as SoftDeleteRepository, t as CascadeOptions } from "./plugin-options-Cirmb4Kp.mjs";
10
- import { n as CreateRepositoryConfig, r as createRepository, t as AuditConfig } from "./create-repository-CJtVdwig.mjs";
11
- import { A as immutableStatesPlugin, B as BulkWriteOptions, D as leasePlugin, E as LeasePluginOptions, F as fieldFilterPlugin, G as appendOnlyPlugin, H as batchOperationsPlugin, I as ElasticSearchOptions, K as AggregateHelpersMethods, L as elasticSearchPlugin, M as IdempotencyStoreMethods, N as IdempotencyStorePluginOptions, O as ImmutableClaimView, P as idempotencyStorePlugin, R as cascadePlugin, S as mongoOperationsPlugin, T as LeaseMethods, U as auditLogPlugin, V as BulkWriteResult, W as AppendOnlyPluginOptions, _ as searchKeysPlugin, a as requireField, b as observabilityPlugin, c as timestampPlugin, d as createTenantContext, f as SubdocumentMethods, g as SearchKeysPluginOptions, h as softDeletePlugin, i as immutableField, j as IdempotencyClaim, k as ImmutableStatesPluginOptions, l as TenantContext, m as SoftDeleteMethods, n as autoInject, o as uniqueField, p as subdocumentPlugin, q as aggregateHelpersPlugin, r as blockIf, s as validationChainPlugin, t as OperationType, u as TenantStore, v as ObservabilityOptions, w as methodRegistryPlugin, x as MongoOperationsMethods, y as OperationMetric, z as BatchOperationsMethods } from "./validation-chain.plugin-BAeC5eVT.mjs";
12
- import { n as SchemaPathsLike, t as FieldType$1 } from "./coercion-BjdPX3YF.mjs";
13
- import { n as SchemaIndexes } from "./indexes-DIjMpYES.mjs";
14
- import { a as prefixSearchFilter, c as SearchMatchRange, d as tokenizeSearchText, f as SEARCH_KEYS_ERROR_CODES, i as buildSearchKeys, l as findSearchMatches, n as MAX_PREFIX_SEARCH_TERMS, o as searchKeysIndex, p as SearchKeysWriteError, r as PrefixSearchFilterOptions, s as searchKeysPath, t as DEFAULT_SEARCH_KEYS_FIELD, u as normalizeSearchText } from "./index-C0AjVqX3.mjs";
15
- import { S as parseDuplicateKeyError, _ as getMongooseProjection, a as createMemoryCache, b as createError, g as getFieldsForUser, h as filterResponseData, i as buildCrudSchemasFromMongooseSchema, m as createFieldPreset, n as CrudSchemasFramework, o as LoggerConfig, r as buildCrudSchemasFromModel, s as configureLogger, t as toPlain, u as idVariants, v as CreateErrorOptions, x as isDuplicateKeyError, y as ParseDuplicateKeyOptions } from "./to-plain-o5tUY2nV.mjs";
1
+ import { a as CreateManyFailure, l as isCreateManyPartialError, o as CreateManyPartial, s as CreateManyPartialError, t as index_d_exports } from "./index-5mhQ63_B.mjs";
2
+ import { a as AggregationBuilder, c as ProjectionSpec, d as VectorSearchOptions, f as RetentionTenantPurgeOptions, i as TransitionMachine, l as SortOrder, n as HOOK_PRIORITY, o as AggregationPlan, r as Repository, s as GroupSpec, t as GetAllParams, u as SortSpec } from "./Repository-DJuRmBNx.mjs";
3
+ import { n as CreateRepositoryConfig, r as createRepository, t as AuditConfig } from "./create-repository-DG-gwOf0.mjs";
4
+ import { C as RepositoryPluginName, S as MongoKitPluginName, _ as RepositoryOptions, a as HookMode, b as WithPlugins, c as MinimalRepoView, d as PluginType, f as PrioritizedHook, g as RepositoryOperation, h as RepositoryInstance, i as EventPhase, l as Plugin, m as RepositoryEvent, n as EventHandlers, o as Middleware, p as RepositoryContext, r as EventPayload, s as MiddlewareContext, t as AllPluginMethods, u as PluginFunction, v as RepositorySearchMode, x as MONGOKIT_PLUGIN_NAMES, y as UserContext } from "./repository-B0aFVgP2.mjs";
5
+ import { A as ObjectId, C as configureQueryDefaults, D as AnyDocument, E as resolveQueryOptions, F as SortSpec$1, M as ReadPreferenceType, N as SelectSpec, O as AnyModel, P as SortDirection, S as configureAggregateDefaults, T as resetQueryDefaults, _ as QueryDefaults, a as CursorPayload, b as WriteConcernSpec, c as MongokitPageExtras, d as ValueType, f as CursorSecret, g as QUERY_DEFAULTS_ERROR_CODES, h as PerCallQueryOptions, i as CountStrategy, j as PopulateSpec, l as OffsetPaginationOptions, m as CommandKind, n as BasePaginationOptions, o as DecodedCursor, p as AggregateDefaults, r as CollationOptions, s as KeysetPaginationOptions, t as AggregatePaginationOptions, u as PaginationConfig, v as ReadConcernLevel, w as getQueryDefaults, x as assertQueryDefaultsConfigured, y as ResolvedQueryOptions } from "./pagination-BAM9cA4N.mjs";
6
+ import { S as LookupOptions, _ as SessionOptions, a as ConvenientTransactionOptions, b as WithTransactionOptions, c as DeleteResult, d as GroupResult, f as LookupPopulateOptions, g as ReadOptions, h as OperationOptions, i as CacheableOptions, l as FindOneAndUpdateOptions, m as MinMaxResult, n as AggregateOptions, o as CreateOptions, p as LookupPopulateResult, r as CacheOperationOptions, t as AggregateCallOptions, u as GetByIdsOptions, v as UpdateManyResult, x as LookupBuilder, y as UpdateOptions } from "./operations-D6XsHx4e.mjs";
7
+ import { n as PaginationEngine, t as CountMemoKey } from "./PaginationEngine-BWb-c47a.mjs";
8
+ import { A as ImmutablePurgeEvent, B as elasticSearchPlugin, D as LeasePluginOptions, E as LeasePendingFilter, F as IdempotencyStoreMethods, G as batchOperationsPlugin, H as BatchOperationsMethods, I as IdempotencyStorePluginOptions, J as AppendOnlyPurgeEvent, K as auditLogPlugin, L as idempotencyStorePlugin, M as ImmutableStatesPluginOptions, N as immutableStatesPlugin, O as leasePlugin, P as IdempotencyClaim, R as fieldFilterPlugin, S as mongoOperationsPlugin, T as LeaseMethods, U as BulkWriteOptions, V as cascadePlugin, W as BulkWriteResult, X as AggregateHelpersMethods, Y as appendOnlyPlugin, Z as aggregateHelpersPlugin, _ as searchKeysPlugin, a as requireField, b as observabilityPlugin, c as timestampPlugin, d as createTenantContext, f as SubdocumentMethods, g as SearchKeysPluginOptions, h as softDeletePlugin, i as immutableField, j as ImmutablePurgeRequest, k as ImmutableClaimView, l as TenantContext, m as SoftDeleteMethods, n as autoInject, o as uniqueField, p as subdocumentPlugin, q as AppendOnlyPluginOptions, r as blockIf, s as validationChainPlugin, t as OperationType, u as TenantStore, v as ObservabilityOptions, w as methodRegistryPlugin, x as MongoOperationsMethods, y as OperationMetric, z as ElasticSearchOptions } from "./validation-chain.plugin-COYrUdd8.mjs";
9
+ import { A as cachePlugin, B as EnsureAuditTrailReadyOptions, C as prefixedId, D as CacheOptions, E as CacheAdapter, F as AuditTrailMethods, H as ensureAuditTrailReady, I as AuditTrailMode, L as AuditTrailOptions, M as AuditOperation, N as AuditQueryOptions, O as RepositoryCacheHandle, P as AuditQueryResult, R as AuditTrailQuery, S as periodCounterKey, T as sequentialId, V as auditTrailPlugin, _ as customIdPlugin, a as DateSequentialIdOptions, b as getNextPeriodSequence, c as PeriodSequenceOptions, d as SequenceCounter, f as SequenceCounterOptions, g as createSequenceCounter, h as civilPeriodKey, i as CustomIdOptions, j as AuditEntry, k as RepositoryCachePluginOptions, l as PeriodSequenceResult, m as SequentialIdOptions, n as adminBypass, o as IdGenerator, p as SequencePeriod, r as multiTenantPlugin, s as PeriodSequenceKeyOptions, t as MultiTenantOptions, u as PrefixedIdOptions, v as dateSequentialId, w as readSequence, x as getNextSequence, y as ensureSequenceAtLeast, z as AuditTrailQueryOptions } from "./multi-tenant.plugin-BTPtCLNK.mjs";
10
+ import { n as RetentionPurgeEvent, r as RetentionPurgeRequest, t as RETENTION_PURGE_ERROR_CODES } from "./retention-purge-CCd_VXUf.mjs";
11
+ import { n as SchemaPathsLike, t as FieldType$1 } from "./coercion-COp9DRNw.mjs";
12
+ import { n as SchemaIndexes } from "./indexes-FfyOuhDK.mjs";
13
+ import { a as SoftDeleteFilterMode, c as ValidationChainOptions, i as Logger, l as ValidatorDefinition, n as CascadeRelation, o as SoftDeleteOptions, r as FieldPreset, s as SoftDeleteRepository, t as CascadeOptions } from "./plugin-options-DrNGWV5b.mjs";
14
+ import { a as InferRawDoc, c as NonNullableFields, d as Strict, f as UpdatePatch, i as InferDocument, l as PartialBy, n as DeepPartial, o as KeysOfType, p as UpdateWithValidationResult, r as DocField, s as MongoOperatorUpdate, t as CreateInput, u as RequiredBy } from "./type-utils-CKvuewAL.mjs";
15
+ import { a as prefixSearchFilter, c as SearchMatchRange, d as tokenizeSearchText, f as SEARCH_KEYS_ERROR_CODES, i as buildSearchKeys, l as findSearchMatches, n as MAX_PREFIX_SEARCH_TERMS, o as searchKeysIndex, p as SearchKeysWriteError, r as PrefixSearchFilterOptions, s as searchKeysPath, t as DEFAULT_SEARCH_KEYS_FIELD, u as normalizeSearchText } from "./index-ehGZLbrd.mjs";
16
+ import { S as parseDuplicateKeyError, _ as getMongooseProjection, a as createMemoryCache, b as createError, g as getFieldsForUser, h as filterResponseData, i as buildCrudSchemasFromMongooseSchema, m as createFieldPreset, n as CrudSchemasFramework, o as LoggerConfig, r as buildCrudSchemasFromModel, s as configureLogger, t as toPlain, u as idVariants, v as CreateErrorOptions, x as isDuplicateKeyError, y as ParseDuplicateKeyOptions } from "./to-plain-Do-8jTKC.mjs";
16
17
  import { RepoCapabilities } from "@classytic/repo-core/repository";
17
18
  import { ClientSession, Connection, Model, PipelineStage, Schema } from "mongoose";
18
19
  import { HttpError } from "@classytic/repo-core/errors";
19
20
  import { KeysetSource } from "@classytic/repo-core/pagination";
20
21
  import "@classytic/repo-core/query-parser";
21
- //#region src/actions/cascade-references.d.ts
22
22
  type PurgeMode = 'hard' | 'soft' | 'anonymize';
23
23
  /** Raw collection surface — a native MongoDB `Collection` or a Mongoose `Model`. */
24
24
  interface CollectionRWLike {
@@ -94,9 +94,7 @@ interface ReferencePurgeResult {
94
94
  * });
95
95
  * ```
96
96
  */
97
- declare function cascadePurgeReferences(options: CascadePurgeReferencesOptions): Promise<ReferencePurgeResult[]>;
98
- //#endregion
99
- //#region src/capabilities.d.ts
97
+ export declare function cascadePurgeReferences(options: CascadePurgeReferencesOptions): Promise<ReferencePurgeResult[]>;
100
98
  /** Three-valued transaction answer. `'unknown'` is NOT `'no'` and NOT `'yes'`. */
101
99
  type TransactionSupport = 'yes' | 'no' | 'unknown';
102
100
  /**
@@ -143,7 +141,7 @@ interface MongoRepoCapabilities extends RepoCapabilities {
143
141
  * which is exactly right for sqlitekit / prismakit / any kit whose answer
144
142
  * genuinely does not depend on a live deployment.
145
143
  */
146
- declare function transactionResolutionOf(caps: RepoCapabilities): CapabilityResolution;
144
+ export declare function transactionResolutionOf(caps: RepoCapabilities): CapabilityResolution;
147
145
  /**
148
146
  * What MongoDB supports through mongokit's surface, DECLARED (not observed).
149
147
  *
@@ -157,7 +155,7 @@ declare function transactionResolutionOf(caps: RepoCapabilities): CapabilityReso
157
155
  * harness (which overrides environment-specific limits where it is
158
156
  * constructed) and as the base every observed descriptor is derived from.
159
157
  */
160
- declare const MONGOKIT_CAPABILITIES: MongoRepoCapabilities;
158
+ export declare const MONGOKIT_CAPABILITIES: MongoRepoCapabilities;
161
159
  interface ServerDescriptionLike {
162
160
  readonly type?: string | undefined;
163
161
  }
@@ -200,7 +198,7 @@ interface CapabilityConnectionLike {
200
198
  * @returns `'yes'` / `'no'` when the topology is conclusive, `'unknown'`
201
199
  * otherwise — never optimistic. See the module docblock on rule 3.
202
200
  */
203
- declare function resolveTransactionSupport(connection: unknown): TransactionSupport;
201
+ export declare function resolveTransactionSupport(connection: unknown): TransactionSupport;
204
202
  /**
205
203
  * The capability descriptor for a LIVE connection — what
206
204
  * `Repository#capabilities` returns.
@@ -209,11 +207,11 @@ declare function resolveTransactionSupport(connection: unknown): TransactionSupp
209
207
  * else comes from {@link MONGOKIT_CAPABILITIES}. Cheap enough to call per
210
208
  * access (topology read + one frozen-object lookup).
211
209
  */
212
- declare function resolveMongoCapabilities(connection: unknown): MongoRepoCapabilities;
210
+ export declare function resolveMongoCapabilities(connection: unknown): MongoRepoCapabilities;
213
211
  /** The three derived descriptors, for tests and for gates that want to compare identity. */
214
- declare function capabilitiesForSupport(support: TransactionSupport): MongoRepoCapabilities;
212
+ export declare function capabilitiesForSupport(support: TransactionSupport): MongoRepoCapabilities;
215
213
  /** Test seam — drop memoized probe answers (a reused connection object across suites). */
216
- declare function resetCapabilityProbeCache(connection?: unknown): void;
214
+ export declare function resetCapabilityProbeCache(connection?: unknown): void;
217
215
  /** Options for {@link probeMongoCapabilities}. */
218
216
  interface CapabilityProbeOptions {
219
217
  /**
@@ -233,7 +231,7 @@ interface CapabilityProbeOptions {
233
231
  * returns `{ isWritablePrimary: true }` and nothing else.
234
232
  * - anything unrecognised ⇒ `'unknown'`. A reply we cannot parse is not a yes.
235
233
  */
236
- declare function classifyHelloReply(reply: Record<string, unknown> | undefined): TransactionSupport;
234
+ export declare function classifyHelloReply(reply: Record<string, unknown> | undefined): TransactionSupport;
237
235
  /**
238
236
  * Resolve a connection's real capabilities, waiting for (and if necessary
239
237
  * asking) the deployment. Memoized per connection: N repositories and N
@@ -255,18 +253,14 @@ declare function classifyHelloReply(reply: Record<string, unknown> | undefined):
255
253
  * Only definitive answers are cached — an `'unknown'` may be re-probed later
256
254
  * (the deployment may simply not have been up yet).
257
255
  */
258
- declare function probeMongoCapabilities(connection: unknown, options?: CapabilityProbeOptions): Promise<MongoRepoCapabilities>;
259
- //#endregion
260
- //#region src/filter/compile.d.ts
261
- declare function compileFilterToMongo(input: unknown,
256
+ export declare function probeMongoCapabilities(connection: unknown, options?: CapabilityProbeOptions): Promise<MongoRepoCapabilities>;
257
+ export declare function compileFilterToMongo(input: unknown,
262
258
  /**
263
259
  * Mongoose schema for the collection being filtered. Supply it wherever it is available:
264
260
  * without it the date coercion guesses from the value's SHAPE alone and silently breaks
265
261
  * range filters on ISO-shaped string columns. See `CoerceFilterDatesOptions.isDateField`.
266
262
  */
267
263
  schema?: Schema): Record<string, unknown>;
268
- //#endregion
269
- //#region src/model-blueprint.d.ts
270
264
  /**
271
265
  * What a bind does when a model name is ALREADY registered on the connection.
272
266
  *
@@ -321,20 +315,18 @@ interface ModelBlueprint<TModels> {
321
315
  * Describe a set of models as a connection-free blueprint. Duplicate spec names are rejected
322
316
  * here, at describe time, before any connection is involved.
323
317
  */
324
- declare function defineModels<TModels>(spec: {
318
+ export declare function defineModels<TModels>(spec: {
325
319
  readonly models: readonly ModelSpec<any>[];
326
320
  /** Turn the bound `name -> Model` map into the kernel's typed model bag. */
327
321
  readonly assemble: (models: ReadonlyMap<string, Model<unknown>>) => TModels;
328
322
  }): ModelBlueprint<TModels>;
329
- //#endregion
330
- //#region src/model-registry.d.ts
331
323
  /**
332
324
  * A model name was already registered when a `throw` policy required it to be free.
333
325
  *
334
326
  * Typed (not a bare `Error`) so consumers — kernels wrapping their own domain collision error,
335
327
  * tests asserting the failure — can `instanceof`-check it instead of matching a message string.
336
328
  */
337
- declare class ModelCollisionError extends Error {
329
+ export declare class ModelCollisionError extends Error {
338
330
  readonly modelName: string;
339
331
  constructor(modelName: string, detail?: string);
340
332
  }
@@ -353,7 +345,7 @@ interface DefineModelOptions {
353
345
  collection?: string;
354
346
  }
355
347
  /** Is this model name already registered? Prefer {@link defineModel} over asking. */
356
- declare function isModelRegistered(name: string, connection?: Connection): boolean;
348
+ export declare function isModelRegistered(name: string, connection?: Connection): boolean;
357
349
  /**
358
350
  * Register a model, or return the existing one, according to `onExisting`.
359
351
  *
@@ -361,9 +353,7 @@ declare function isModelRegistered(name: string, connection?: Connection): boole
361
353
  * schema has side effects (plugin application, index declaration) that should not run for
362
354
  * a registration that is about to be discarded.
363
355
  */
364
- declare function defineModel<TDoc>(name: string, schema: () => Schema<TDoc>, options: DefineModelOptions): Model<TDoc>;
365
- //#endregion
366
- //#region src/operations.d.ts
356
+ export declare function defineModel<TDoc>(name: string, schema: () => Schema<TDoc>, options: DefineModelOptions): Model<TDoc>;
367
357
  /**
368
358
  * Where a plugin should inject its scoping filter (multi-tenant scope,
369
359
  * soft-delete filter, etc.) on the RepositoryContext.
@@ -389,17 +379,15 @@ interface OperationDescriptor {
389
379
  * Adding a new RepositoryOperation requires exactly one entry here, after
390
380
  * which every bundled plugin auto-classifies it correctly.
391
381
  */
392
- declare const OP_REGISTRY: Readonly<Record<RepositoryOperation, OperationDescriptor>>;
382
+ export declare const OP_REGISTRY: Readonly<Record<RepositoryOperation, OperationDescriptor>>;
393
383
  /** All known repository operations, in registry order. */
394
- declare const ALL_OPERATIONS: RepositoryOperation[];
384
+ export declare const ALL_OPERATIONS: RepositoryOperation[];
395
385
  /** Operations that mutate the database. Drives audit + cache invalidation lists. */
396
- declare const MUTATING_OPERATIONS: readonly RepositoryOperation[];
386
+ export declare const MUTATING_OPERATIONS: readonly RepositoryOperation[];
397
387
  /** Operations that don't mutate. Drives default cacheable ops. */
398
- declare const READ_OPERATIONS: readonly RepositoryOperation[];
388
+ export declare const READ_OPERATIONS: readonly RepositoryOperation[];
399
389
  /** Filter ops by their policy injection key. */
400
- declare function operationsByPolicyKey(key: PolicyKey): RepositoryOperation[];
401
- //#endregion
402
- //#region src/pagination/defaults.d.ts
390
+ export declare function operationsByPolicyKey(key: PolicyKey): RepositoryOperation[];
403
391
  /**
404
392
  * The subset of {@link PaginationConfig} that describes a deployment rather
405
393
  * than one collection's shape.
@@ -457,34 +445,28 @@ interface PaginationDefaults {
457
445
  * made after traffic starts changes behaviour mid-flight, which is rarely what
458
446
  * anyone means.
459
447
  */
460
- declare function configurePaginationDefaults(defaults: PaginationDefaults): void;
448
+ export declare function configurePaginationDefaults(defaults: PaginationDefaults): void;
461
449
  /**
462
450
  * The current deployment policy. Empty until something configures it.
463
451
  *
464
452
  * A COPY — `Readonly<T>` is erased at runtime, and handing out the live object
465
453
  * would let a caller mutate the policy through a getter that promised not to.
466
454
  */
467
- declare function getPaginationDefaults(): Readonly<PaginationDefaults>;
455
+ export declare function getPaginationDefaults(): Readonly<PaginationDefaults>;
468
456
  /** Back to library defaults. For tests — a global that cannot be reset is a leak between them. */
469
- declare function resetPaginationDefaults(): void;
470
- //#endregion
471
- //#region src/pagination/keyset-source.d.ts
457
+ export declare function resetPaginationDefaults(): void;
472
458
  interface KeysetSourceOptions extends ReadOptions {
473
459
  name: string;
474
460
  sort: SortSpec$1;
475
461
  filters?: Record<string, unknown>;
476
462
  }
477
- declare function keysetSource<TDoc>(repo: Repository<TDoc>, options: KeysetSourceOptions): KeysetSource<TDoc>;
478
- //#endregion
479
- //#region src/pagination/utils/guards.d.ts
480
- declare const PAGINATION_ERROR_CODES: {
481
- readonly OFFSET_TOO_DEEP: "mongokit.pagination.offset_too_deep";
463
+ export declare function keysetSource<TDoc>(repo: Repository<TDoc>, options: KeysetSourceOptions): KeysetSource<TDoc>;
464
+ export declare const PAGINATION_ERROR_CODES: {
465
+ readonly OFFSET_TOO_DEEP: 'mongokit.pagination.offset_too_deep';
482
466
  /** repo-core's shared cursor vocabulary (one code set across kits and merged cursors). */
483
467
  readonly CURSOR_INVALID: "repo.cursor.invalid";
484
468
  readonly CURSOR_SCOPE_MISMATCH: "repo.cursor.scope_mismatch";
485
469
  };
486
- //#endregion
487
- //#region src/query/parser/types.d.ts
488
470
  type SortSpec$2 = Record<string, 1 | -1>;
489
471
  type FilterQuery = Record<string, unknown>;
490
472
  /**
@@ -646,20 +628,16 @@ interface QueryParserOptions {
646
628
  */
647
629
  fieldTypes?: Record<string, FieldType>;
648
630
  }
649
- //#endregion
650
- //#region src/query/parser/schema-docs.d.ts
651
631
  interface QuerySchema {
652
632
  type: 'object';
653
633
  properties: Record<string, unknown>;
654
634
  required?: string[];
655
635
  }
656
- //#endregion
657
- //#region src/query/QueryParser.d.ts
658
636
  /**
659
637
  * Modern Query Parser
660
638
  * Converts URL parameters to MongoDB queries with $lookup support
661
639
  */
662
- declare class QueryParser {
640
+ export declare class QueryParser {
663
641
  /**
664
642
  * Shared runtime handed to every parser module. `schema` and `fieldTypes`
665
643
  * are consumed once at construction to build the coercion map and are not
@@ -739,22 +717,18 @@ declare class QueryParser {
739
717
  properties: Record<string, unknown>;
740
718
  };
741
719
  }
742
- //#endregion
743
- //#region src/repository/join-scope.d.ts
744
720
  /** Returns the predicate a read of the owning collection carries for this call, or none. */
745
721
  type CollectionScopeRule = (context: RepositoryContext, operation: string) => Record<string, unknown> | undefined;
746
- declare const JOIN_ERROR_CODES: {
747
- readonly UNKNOWN_COLLECTION: "mongokit.join.unknown_collection";
748
- readonly UNGOVERNED_COLLECTION: "mongokit.join.ungoverned_collection";
749
- readonly UNSCOPE_REFUSED: "mongokit.join.unscope_refused";
750
- readonly UNRESOLVABLE_FROM: "mongokit.join.unresolvable_from";
722
+ export declare const JOIN_ERROR_CODES: {
723
+ readonly UNKNOWN_COLLECTION: 'mongokit.join.unknown_collection';
724
+ readonly UNGOVERNED_COLLECTION: 'mongokit.join.ungoverned_collection';
725
+ readonly UNSCOPE_REFUSED: 'mongokit.join.unscope_refused';
726
+ readonly UNRESOLVABLE_FROM: 'mongokit.join.unresolvable_from';
751
727
  };
752
728
  /** Called by a policy plugin at bind: reads of this model's collection carry `rule`. */
753
- declare function declareCollectionScope(model: object, rule: CollectionScopeRule, meta?: {
729
+ export declare function declareCollectionScope(model: object, rule: CollectionScopeRule, meta?: {
754
730
  tenantField?: string;
755
731
  }): void;
756
- //#endregion
757
- //#region src/search/rebuild.d.ts
758
732
  /** A prefix-mode `Repository` satisfies this: `rebuildSearchKeys(repo)`. */
759
733
  interface SearchKeysSource {
760
734
  Model: Model<any, any, any, any>;
@@ -780,9 +754,7 @@ interface RebuildSearchKeysResult {
780
754
  /** Documents whose keys were missing or stale and were rewritten (server-reported). */
781
755
  updated: number;
782
756
  }
783
- declare function rebuildSearchKeys(source: SearchKeysSource | Model<any, any, any, any>, options?: RebuildSearchKeysOptions): Promise<RebuildSearchKeysResult>;
784
- //#endregion
785
- //#region src/transaction.d.ts
757
+ export declare function rebuildSearchKeys(source: SearchKeysSource | Model<any, any, any, any>, options?: RebuildSearchKeysOptions): Promise<RebuildSearchKeysResult>;
786
758
  /** Minimal shape we need from a Mongoose connection. */
787
759
  interface SessionStarter {
788
760
  startSession(): Promise<ClientSession>;
@@ -810,21 +782,22 @@ interface SessionStarter {
810
782
  * });
811
783
  * ```
812
784
  */
813
- declare function withTransaction<T>(connection: SessionStarter, callback: (session: ClientSession) => Promise<T>, options?: WithTransactionOptions): Promise<T>;
814
- declare const TRANSACTION_ERROR_CODES: {
785
+ export declare function withTransaction<T>(connection: SessionStarter, callback: (session: ClientSession) => Promise<T>, options?: WithTransactionOptions): Promise<T>;
786
+ export declare const TRANSACTION_ERROR_CODES: {
815
787
  /** The session lacks a method the transaction loop drives (a partial or wrapped fake). */
816
- readonly SESSION_INCOMPLETE: "mongokit.transaction.session_incomplete";
788
+ readonly SESSION_INCOMPLETE: 'mongokit.transaction.session_incomplete';
817
789
  };
818
790
  /**
819
791
  * The driver's convenient-transaction algorithm (start → callback → commit, label-based retry,
820
- * jittered backoff, a deadline), run here so the driver never attaches a session `timeoutContext`:
821
- * with one, every legacy bulk write (`insertMany`, `bulkWrite`) in the transaction is refused once
822
- * the client carries `timeoutMS` (driver <= 7.7: the bulk path re-resolves the inherited client
823
- * `timeoutMS` as a per-op one). Each operation keeps its own per-op CSOT budget instead.
824
- * Deadline: `transactionOptions.timeoutMS`, else the client's `timeoutMS`, else 120 s (as the driver).
825
- * Pinned by `tests/integration/csot-transaction-matrix.test.ts`.
792
+ * jittered backoff, a deadline), run here and nowhere else: the driver's own `timeoutMS` / CSOT is a
793
+ * no-op since 7.8, so the budget is mongokit's. `transactionOptions.timeoutMS` is that budget, enforced
794
+ * by mongokit alone: every mongokit operation in the transaction is sent with `maxTimeMS` = what
795
+ * remains of it, the commit is bounded by `maxCommitTimeMS`, and the retry loop stops at the deadline
796
+ * (a spent budget before the commit aborts, so the outcome is known). Without it the deadline is 120 s
797
+ * (as the driver) and operations carry only their own bound. The client's `timeoutMS` is not read.
798
+ * Pinned by `tests/integration/transaction-budget-matrix.test.ts`.
826
799
  */
827
- declare function runTransaction<T>(session: ClientSession, callback: (session: ClientSession) => Promise<T>, transactionOptions?: ConvenientTransactionOptions): Promise<T>;
800
+ export declare function runTransaction<T>(session: ClientSession, callback: (session: ClientSession) => Promise<T>, transactionOptions?: ConvenientTransactionOptions): Promise<T>;
828
801
  /**
829
802
  * Multi-repo transactional batch — every repo in `repos` becomes a
830
803
  * session-bound proxy inside the callback. Eliminates the per-call
@@ -878,7 +851,7 @@ declare function runTransaction<T>(session: ClientSession, callback: (session: C
878
851
  * @param callback - Receives the bound repo map. Return value flows
879
852
  * through to the outer `Promise`.
880
853
  */
881
- declare function batchTransaction<TRepos extends Record<string, object>, TResult>(connection: SessionStarter, repos: TRepos, callback: (bound: TRepos) => Promise<TResult>, options?: WithTransactionOptions): Promise<TResult>;
854
+ export declare function batchTransaction<TRepos extends Record<string, object>, TResult>(connection: SessionStarter, repos: TRepos, callback: (bound: TRepos) => Promise<TResult>, options?: WithTransactionOptions): Promise<TResult>;
882
855
  /**
883
856
  * Detect whether an error indicates the MongoDB deployment does not support
884
857
  * multi-document transactions (standalone server, older topology, etc.).
@@ -894,7 +867,7 @@ declare function batchTransaction<TRepos extends Record<string, object>, TResult
894
867
  * So we accept that message as equivalent — the underlying topology
895
868
  * problem is the same, and the fallback semantics are correct either way.
896
869
  */
897
- declare function isTransactionUnsupported(error: Error): boolean;
870
+ export declare function isTransactionUnsupported(error: Error): boolean;
898
871
  /**
899
872
  * PROACTIVELY report whether a connection's deployment supports multi-document
900
873
  * transactions — the read-side companion to {@link isTransactionUnsupported}
@@ -919,9 +892,7 @@ declare function isTransactionUnsupported(error: Error): boolean;
919
892
  * Accepts a Mongoose `Connection` (or anything exposing `getClient()`/`client`
920
893
  * with a driver `topology`), so it stays decoupled from mongoose types.
921
894
  */
922
- declare function supportsTransactions(connection: unknown): boolean;
923
- //#endregion
924
- //#region src/utils/scope.d.ts
895
+ export declare function supportsTransactions(connection: unknown): boolean;
925
896
  /** The fields that decide whose rows an operation touches, and inside which transaction. */
926
897
  interface RepoScope {
927
898
  /** Platform-admin escape hatch. Present only when the source carried no tenant. */
@@ -938,9 +909,9 @@ interface RepoScope {
938
909
  * `multiTenantPlugin` at bind, so forwarding knows a custom key (`branchId`)
939
910
  * without the host restating it.
940
911
  */
941
- declare function declareTenantContextKey(repo: object, contextKey: string): void;
912
+ export declare function declareTenantContextKey(repo: object, contextKey: string): void;
942
913
  /** Every tenant context key relevant to a call spanning these repositories. */
943
- declare function tenantContextKeysOf(...repos: ReadonlyArray<object | undefined>): string[];
914
+ export declare function tenantContextKeysOf(...repos: ReadonlyArray<object | undefined>): string[];
944
915
  /**
945
916
  * The scope to hand a second repository call made on behalf of `source`
946
917
  * (a hook's `RepositoryContext`, or a host's request context).
@@ -948,9 +919,7 @@ declare function tenantContextKeysOf(...repos: ReadonlyArray<object | undefined>
948
919
  * Absent values are omitted, never written as `undefined`, so spreading the
949
920
  * result into an options bag cannot erase a value set there.
950
921
  */
951
- declare function forwardScope(source: Record<string, unknown> | null | undefined, tenantKeys?: readonly string[]): RepoScope;
952
- //#endregion
953
- //#region src/utils/repo-options.d.ts
922
+ export declare function forwardScope(source: Record<string, unknown> | null | undefined, tenantKeys?: readonly string[]): RepoScope;
954
923
  /**
955
924
  * Forward request-scoped context fields into a mongokit options bag.
956
925
  *
@@ -1009,7 +978,7 @@ declare function forwardScope(source: Record<string, unknown> | null | undefined
1009
978
  *
1010
979
  * Domain fields beyond this set belong to `createOptionsExtractor`.
1011
980
  */
1012
- declare function repoOptionsFromCtx<TCtx extends Record<string, unknown>>(ctx: TCtx | undefined | null): RepoScope;
981
+ export declare function repoOptionsFromCtx<TCtx extends Record<string, unknown>>(ctx: TCtx | undefined | null): RepoScope;
1013
982
  /**
1014
983
  * Build a typed extractor for **consumer-defined** ctx → options
1015
984
  * forwarding. Same conceptual shape as `repoOptionsFromCtx`, but the
@@ -1069,7 +1038,7 @@ declare function repoOptionsFromCtx<TCtx extends Record<string, unknown>>(ctx: T
1069
1038
  * that omits absent/undefined keys (so spreading into a parent
1070
1039
  * options bag never erases inherited values).
1071
1040
  */
1072
- declare function createOptionsExtractor<TCtx extends Record<string, unknown>>(fields: readonly (keyof TCtx & string)[]): (ctx: TCtx | undefined | null) => Record<string, unknown>;
1041
+ export declare function createOptionsExtractor<TCtx extends Record<string, unknown>>(fields: readonly (keyof TCtx & string)[]): (ctx: TCtx | undefined | null) => Record<string, unknown>;
1073
1042
  /**
1074
1043
  * Canonical options bag for repo calls made OUTSIDE any request scope —
1075
1044
  * event handlers, cron jobs, queue workers, migration scripts.
@@ -1143,6 +1112,5 @@ declare function createOptionsExtractor<TCtx extends Record<string, unknown>>(fi
1143
1112
  * load-bearing.
1144
1113
  * @returns A `SessionOptions` object with `bypassTenant: true` set.
1145
1114
  */
1146
- declare function systemContext(extra?: SessionOptions): SessionOptions;
1147
- //#endregion
1148
- export { ALL_OPERATIONS, type AggregateCallOptions, type AggregateDefaults, type AggregateHelpersMethods, type AggregateOptions, type AggregatePaginationOptions, AggregationBuilder, type AggregationPlan, type SortOrder as AggregationSortOrder, type SortSpec as AggregationSortSpec, type AllPluginMethods, type AnyDocument, type AnyModel, type AppendOnlyPluginOptions, type AuditConfig, type AuditEntry, type AuditOperation, type AuditQueryOptions, type AuditQueryResult, type AuditTrailMethods, type AuditTrailMode, type AuditTrailOptions, AuditTrailQuery, type AuditTrailQueryOptions, type BasePaginationOptions, type BatchOperationsMethods, type BulkWriteOptions, type BulkWriteResult, type CacheAdapter, type CacheOperationOptions, type CacheOptions, type CacheableOptions, type CapabilityConnectionLike, type CapabilityProbeOptions, type CapabilityResolution, type CascadeOptions, type CascadePurgeReferencesOptions, type CascadeRelation, type CollationOptions, type CollectionRWLike, type CollectionScopeRule, type CommandKind, type ConvenientTransactionOptions, type CountMemoKey, type CountStrategy, type CreateErrorOptions, type CreateInput, type CreateManyFailure, type CreateManyPartial, type CreateManyPartialError, type CreateOptions, type CreateRepositoryConfig, type CrudSchemasFramework, type CursorPayload, type CursorSecret, type CustomIdOptions, DEFAULT_SEARCH_KEYS_FIELD, type DateSequentialIdOptions, type DecodedCursor, type DeepPartial, type DefineModelOptions, type DeleteResult, type DocField, type ElasticSearchOptions, type EnsureAuditTrailReadyOptions, type EventHandlers, type EventPayload, type EventPhase, type ExistingModelPolicy, type FieldPreset, type FieldType, type FilterQuery, type FindOneAndUpdateOptions, type GetAllParams, type GetByIdsOptions, type GroupResult, type GroupSpec, HOOK_PRIORITY, type HookMode, type IdGenerator, type IdempotencyClaim, type IdempotencyStoreMethods, type IdempotencyStorePluginOptions, type ImmutableClaimView, type ImmutableStatesPluginOptions, type InferDocument, type InferRawDoc, JOIN_ERROR_CODES, type KeysOfType, type KeysetPaginationOptions, type KeysetSourceOptions, type LeaseMethods, type LeasePluginOptions, type Logger, type LoggerConfig, LookupBuilder, type LookupOptions, type LookupPopulateOptions, type LookupPopulateResult, MAX_PREFIX_SEARCH_TERMS, MONGOKIT_CAPABILITIES, MONGOKIT_PLUGIN_NAMES, MUTATING_OPERATIONS, type Middleware, type MiddlewareContext, type MinMaxResult, type MinimalRepoView, type ModelBlueprint, ModelCollisionError, type ModelSpec, type MongoKitPluginName, type MongoOperationsMethods, type MongoOperatorUpdate, type MongoRepoCapabilities, type MongokitPageExtras, type MultiTenantOptions, type NonNullableFields, OP_REGISTRY, type ObjectId, type ObservabilityOptions, type OffsetPaginationOptions, type OperationDescriptor, type OperationMetric, type OperationOptions, type OperationType, PAGINATION_ERROR_CODES, type PaginationConfig, type PaginationDefaults, PaginationEngine, type ParseDuplicateKeyOptions, type ParsedQuery, type PartialBy, type PerCallQueryOptions, type Plugin, type PluginFunction, type PluginType, type PolicyKey, type PopulateOption, type PopulateSpec, type PrefixSearchFilterOptions, type PrefixedIdOptions, type PrioritizedHook, type ProjectionSpec, type PurgeMode, type PurgeableRepoLike, QUERY_DEFAULTS_ERROR_CODES, type QueryDefaults, QueryParser, type QueryParserOptions, type QuerySchema, READ_OPERATIONS, type ReadConcernLevel, type ReadOptions, type ReadPreferenceType, type RebuildSearchKeysOptions, type RebuildSearchKeysResult, type ReferencePurgeResult, type ReferenceRelation, type RepoScope, Repository, Repository as default, type RepositoryCacheHandle, type RepositoryCachePluginOptions, type RepositoryContext, type RepositoryEvent, type RepositoryInstance, type RepositoryOperation, type RepositoryOptions, type RepositoryPluginName, type RepositorySearchMode, type RequiredBy, type ResolvedQueryOptions, SEARCH_KEYS_ERROR_CODES, type SchemaLike, type SearchKeysPluginOptions, type SearchKeysSource, SearchKeysWriteError, type SearchMatchRange, type SearchMode, type SelectSpec, type SequentialIdOptions, type SessionOptions, type SessionStarter, type SoftDeleteFilterMode, type SoftDeleteMethods, type SoftDeleteOptions, type SoftDeleteRepository, type SortDirection, type SortSpec$1 as SortSpec, type Strict, type SubdocumentMethods, TRANSACTION_ERROR_CODES, type TenantContext, type TenantStore, type TransactionSupport, type TransitionMachine, type UpdateManyResult, type UpdateOptions, type UpdatePatch, type UpdateWithValidationResult, type UserContext, type ValidationChainOptions, type ValidatorDefinition, type ValueType, type VectorSearchOptions, type WithPlugins, type WithTransactionOptions, type WriteConcernSpec, index_d_exports as actions, adminBypass, aggregateHelpersPlugin, appendOnlyPlugin, assertQueryDefaultsConfigured, auditLogPlugin, auditTrailPlugin, autoInject, batchOperationsPlugin, batchTransaction, blockIf, buildCrudSchemasFromModel, buildCrudSchemasFromMongooseSchema, buildSearchKeys, cachePlugin, capabilitiesForSupport, cascadePlugin, cascadePurgeReferences, classifyHelloReply, compileFilterToMongo, configureAggregateDefaults, configureLogger, configurePaginationDefaults, configureQueryDefaults, createError, createFieldPreset, createMemoryCache, createOptionsExtractor, createRepository, createTenantContext, customIdPlugin, dateSequentialId, declareCollectionScope, declareTenantContextKey, defineModel, defineModels, elasticSearchPlugin, ensureAuditTrailReady, ensureSequenceAtLeast, fieldFilterPlugin, filterResponseData, findSearchMatches, forwardScope, getFieldsForUser, getMongooseProjection, getNextSequence, getPaginationDefaults, getQueryDefaults, idVariants, idempotencyStorePlugin, immutableField, immutableStatesPlugin, isCreateManyPartialError, isDuplicateKeyError, isModelRegistered, isTransactionUnsupported, keysetSource, leasePlugin, methodRegistryPlugin, mongoOperationsPlugin, multiTenantPlugin, normalizeSearchText, observabilityPlugin, operationsByPolicyKey, parseDuplicateKeyError, prefixSearchFilter, prefixedId, probeMongoCapabilities, readSequence, rebuildSearchKeys, repoOptionsFromCtx, requireField, resetCapabilityProbeCache, resetPaginationDefaults, resetQueryDefaults, resolveMongoCapabilities, resolveQueryOptions, resolveTransactionSupport, runTransaction, searchKeysIndex, searchKeysPath, searchKeysPlugin, sequentialId, softDeletePlugin, subdocumentPlugin, supportsTransactions, systemContext, tenantContextKeysOf, timestampPlugin, toPlain, tokenizeSearchText, transactionResolutionOf, uniqueField, validationChainPlugin, withTransaction };
1115
+ export declare function systemContext(extra?: SessionOptions): SessionOptions;
1116
+ export { type AggregateCallOptions, type AggregateDefaults, type AggregateHelpersMethods, type AggregateOptions, type AggregatePaginationOptions, AggregationBuilder, type AggregationPlan, type SortOrder as AggregationSortOrder, type SortSpec as AggregationSortSpec, type AllPluginMethods, type AnyDocument, type AnyModel, type AppendOnlyPluginOptions, type AppendOnlyPurgeEvent, type AuditConfig, type AuditEntry, type AuditOperation, type AuditQueryOptions, type AuditQueryResult, type AuditTrailMethods, type AuditTrailMode, type AuditTrailOptions, AuditTrailQuery, type AuditTrailQueryOptions, type BasePaginationOptions, type BatchOperationsMethods, type BulkWriteOptions, type BulkWriteResult, type CacheAdapter, type CacheOperationOptions, type CacheOptions, type CacheableOptions, type CapabilityConnectionLike, type CapabilityProbeOptions, type CapabilityResolution, type CascadeOptions, type CascadePurgeReferencesOptions, type CascadeRelation, type CollationOptions, type CollectionRWLike, type CollectionScopeRule, type CommandKind, type ConvenientTransactionOptions, type CountMemoKey, type CountStrategy, type CreateErrorOptions, type CreateInput, type CreateManyFailure, type CreateManyPartial, type CreateManyPartialError, type CreateOptions, type CreateRepositoryConfig, type CrudSchemasFramework, type CursorPayload, type CursorSecret, type CustomIdOptions, DEFAULT_SEARCH_KEYS_FIELD, type DateSequentialIdOptions, type DecodedCursor, type DeepPartial, type DefineModelOptions, type DeleteResult, type DocField, type ElasticSearchOptions, type EnsureAuditTrailReadyOptions, type EventHandlers, type EventPayload, type EventPhase, type ExistingModelPolicy, type FieldPreset, type FieldType, type FilterQuery, type FindOneAndUpdateOptions, type GetAllParams, type GetByIdsOptions, type GroupResult, type GroupSpec, HOOK_PRIORITY, type HookMode, type IdGenerator, type IdempotencyClaim, type IdempotencyStoreMethods, type IdempotencyStorePluginOptions, type ImmutableClaimView, type ImmutablePurgeEvent, type ImmutablePurgeRequest, type ImmutableStatesPluginOptions, type InferDocument, type InferRawDoc, type KeysOfType, type KeysetPaginationOptions, type KeysetSourceOptions, type LeaseMethods, type LeasePendingFilter, type LeasePluginOptions, type Logger, type LoggerConfig, LookupBuilder, type LookupOptions, type LookupPopulateOptions, type LookupPopulateResult, MAX_PREFIX_SEARCH_TERMS, MONGOKIT_PLUGIN_NAMES, type Middleware, type MiddlewareContext, type MinMaxResult, type MinimalRepoView, type ModelBlueprint, type ModelSpec, type MongoKitPluginName, type MongoOperationsMethods, type MongoOperatorUpdate, type MongoRepoCapabilities, type MongokitPageExtras, type MultiTenantOptions, type NonNullableFields, type ObjectId, type ObservabilityOptions, type OffsetPaginationOptions, type OperationDescriptor, type OperationMetric, type OperationOptions, type OperationType, type PaginationConfig, type PaginationDefaults, PaginationEngine, type ParseDuplicateKeyOptions, type ParsedQuery, type PartialBy, type PerCallQueryOptions, type PeriodSequenceKeyOptions, type PeriodSequenceOptions, type PeriodSequenceResult, type Plugin, type PluginFunction, type PluginType, type PolicyKey, type PopulateOption, type PopulateSpec, type PrefixSearchFilterOptions, type PrefixedIdOptions, type PrioritizedHook, type ProjectionSpec, type PurgeMode, type PurgeableRepoLike, QUERY_DEFAULTS_ERROR_CODES, type QueryDefaults, type QueryParserOptions, type QuerySchema, RETENTION_PURGE_ERROR_CODES, type ReadConcernLevel, type ReadOptions, type ReadPreferenceType, type RebuildSearchKeysOptions, type RebuildSearchKeysResult, type ReferencePurgeResult, type ReferenceRelation, type RepoScope, Repository, Repository as default, type RepositoryCacheHandle, type RepositoryCachePluginOptions, type RepositoryContext, type RepositoryEvent, type RepositoryInstance, type RepositoryOperation, type RepositoryOptions, type RepositoryPluginName, type RepositorySearchMode, type RequiredBy, type ResolvedQueryOptions, type RetentionPurgeEvent, type RetentionPurgeRequest, type RetentionTenantPurgeOptions, SEARCH_KEYS_ERROR_CODES, type SchemaLike, type SearchKeysPluginOptions, type SearchKeysSource, SearchKeysWriteError, type SearchMatchRange, type SearchMode, type SelectSpec, type SequenceCounter, type SequenceCounterOptions, type SequencePeriod, type SequentialIdOptions, type SessionOptions, type SessionStarter, type SoftDeleteFilterMode, type SoftDeleteMethods, type SoftDeleteOptions, type SoftDeleteRepository, type SortDirection, type SortSpec$1 as SortSpec, type Strict, type SubdocumentMethods, type TenantContext, type TenantStore, type TransactionSupport, type TransitionMachine, type UpdateManyResult, type UpdateOptions, type UpdatePatch, type UpdateWithValidationResult, type UserContext, type ValidationChainOptions, type ValidatorDefinition, type ValueType, type VectorSearchOptions, type WithPlugins, type WithTransactionOptions, type WriteConcernSpec, index_d_exports as actions, adminBypass, aggregateHelpersPlugin, appendOnlyPlugin, assertQueryDefaultsConfigured, auditLogPlugin, auditTrailPlugin, autoInject, batchOperationsPlugin, blockIf, buildCrudSchemasFromModel, buildCrudSchemasFromMongooseSchema, buildSearchKeys, cachePlugin, cascadePlugin, civilPeriodKey, configureAggregateDefaults, configureLogger, configureQueryDefaults, createError, createFieldPreset, createMemoryCache, createRepository, createSequenceCounter, createTenantContext, customIdPlugin, dateSequentialId, elasticSearchPlugin, ensureAuditTrailReady, ensureSequenceAtLeast, fieldFilterPlugin, filterResponseData, findSearchMatches, getFieldsForUser, getMongooseProjection, getNextPeriodSequence, getNextSequence, getQueryDefaults, idVariants, idempotencyStorePlugin, immutableField, immutableStatesPlugin, isCreateManyPartialError, isDuplicateKeyError, leasePlugin, methodRegistryPlugin, mongoOperationsPlugin, multiTenantPlugin, normalizeSearchText, observabilityPlugin, parseDuplicateKeyError, periodCounterKey, prefixSearchFilter, prefixedId, readSequence, requireField, resetQueryDefaults, resolveQueryOptions, searchKeysIndex, searchKeysPath, searchKeysPlugin, sequentialId, softDeletePlugin, subdocumentPlugin, timestampPlugin, toPlain, tokenizeSearchText, uniqueField, validationChainPlugin };