@classytic/mongokit 3.39.0 → 3.40.1

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 (51) hide show
  1. package/README.md +71 -0
  2. package/dist/{PaginationEngine-D-P19Y9m.d.mts → PaginationEngine-CRHyuUtw.d.mts} +17 -3
  3. package/dist/{PaginationEngine-DQ7beTCR.mjs → PaginationEngine-CfT2Cxkj.mjs} +320 -145
  4. package/dist/{Repository-D7fDpyFx.mjs → Repository-CYhSC9ut.mjs} +844 -794
  5. package/dist/{Repository-IxI983_m.d.mts → Repository-pnLw1rG5.d.mts} +113 -47
  6. package/dist/actions/index.d.mts +1 -1
  7. package/dist/actions/index.mjs +1 -1
  8. package/dist/adapter/index.mjs +1 -1
  9. package/dist/{adapter-BrVfPFSW.mjs → adapter-CkMoMF83.mjs} +1 -1
  10. package/dist/ai/index.d.mts +1 -1
  11. package/dist/better-auth/index.mjs +2 -2
  12. package/dist/{create-repository-CRXjDa3N.d.mts → create-repository-BUx9vfG9.d.mts} +5 -5
  13. package/dist/{create-repository-DOe9E_5F.mjs → create-repository-BYyWzLbt.mjs} +2 -2
  14. package/dist/idempotency/index.d.mts +23 -0
  15. package/dist/idempotency/index.mjs +134 -0
  16. package/dist/{index-CmjNyulu.d.mts → index-SYF8N28D.d.mts} +37 -19
  17. package/dist/index.d.mts +105 -39
  18. package/dist/index.mjs +332 -676
  19. package/dist/indexes/verify-indexes.d.mts +14 -1
  20. package/dist/indexes/verify-indexes.mjs +54 -7
  21. package/dist/join-scope-DSAznE8E.mjs +168 -0
  22. package/dist/{mongooseToJsonSchema-waUVQwK4.mjs → mongooseToJsonSchema-C3k4ide0.mjs} +5 -1
  23. package/dist/{multi-tenant.plugin-B-tzNeYL.d.mts → multi-tenant.plugin-a3UhQARj.d.mts} +19 -3
  24. package/dist/{operations-CrRIoc8Z.d.mts → operations-XiFgG5US.d.mts} +36 -13
  25. package/dist/outbox/index.d.mts +1 -1
  26. package/dist/outbox/index.mjs +6 -4
  27. package/dist/pagination/PaginationEngine.d.mts +2 -2
  28. package/dist/pagination/PaginationEngine.mjs +1 -1
  29. package/dist/pagination/utils/limits.d.mts +1 -1
  30. package/dist/{pagination-BpIv2bdS.d.mts → pagination-D6psses0.d.mts} +116 -13
  31. package/dist/{plugin-options-BuvtOSZf.d.mts → plugin-options-CRhIvSzx.d.mts} +16 -2
  32. package/dist/plugins/index.d.mts +8 -3
  33. package/dist/plugins/index.mjs +98 -25
  34. package/dist/query-defaults-BxUcSOoF.mjs +208 -0
  35. package/dist/read-model/index.d.mts +66 -0
  36. package/dist/read-model/index.mjs +193 -0
  37. package/dist/{repository-ZbLtL7Nk.d.mts → repository-DNHfjAZX.d.mts} +36 -4
  38. package/dist/sync/index.d.mts +53 -0
  39. package/dist/sync/index.mjs +371 -0
  40. package/dist/tenant/index.mjs +2 -0
  41. package/dist/testkit/index.d.mts +40 -3
  42. package/dist/testkit/index.mjs +113 -2
  43. package/dist/{timestamp.plugin-B5eiaItQ.mjs → timestamp.plugin-zfdLYZiO.mjs} +135 -32
  44. package/dist/{to-plain-B8ufk3Qz.d.mts → to-plain-CjgEInWV.d.mts} +2 -2
  45. package/dist/transaction-BrRYtH_b.mjs +655 -0
  46. package/dist/{update-c_01A0if.mjs → update-WgeAUJ_I.mjs} +212 -33
  47. package/dist/utils/index.d.mts +1 -1
  48. package/dist/utils/index.mjs +1 -1
  49. package/dist/{validation-chain.plugin-Bju1D1Sn.mjs → validation-chain.plugin-CHUHWMtk.mjs} +204 -279
  50. package/dist/{validation-chain.plugin-DvrLJIbJ.d.mts → validation-chain.plugin-CTcNJCmV.d.mts} +27 -5
  51. package/package.json +18 -4
@@ -1,5 +1,5 @@
1
- import { _ as UpdateOptions, a as CreateOptions, b as LookupOptions, c as FindOneAndUpdateOptions, f as MinMaxResult, g as UpdateManyResult, l as GroupResult, p as OperationOptions, s as DeleteResult } from "./operations-CrRIoc8Z.mjs";
2
- import { _ as PopulateSpec, g as ObjectId, p as AnyDocument, v as ReadPreferenceType, x as SortSpec, y as SelectSpec } from "./pagination-BpIv2bdS.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-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
3
  import { p as UpdateWithValidationResult } from "./type-utils-CLzRFtIA.mjs";
4
4
  import { Model, PipelineStage } from "mongoose";
5
5
  declare namespace aggregate_d_exports {
@@ -79,7 +79,7 @@ declare function facet<TResult = Record<string, unknown[]>>(Model: Model<any>, f
79
79
  */
80
80
  declare function distinct<T = unknown>(Model: Model<any>, field: string, query?: Record<string, unknown>, options?: {
81
81
  session?: unknown;
82
- readPreference?: string;
82
+ queryOptions?: ResolvedQueryOptions;
83
83
  }): Promise<T[]>;
84
84
  /**
85
85
  * Calculate sum
@@ -102,10 +102,14 @@ declare function minMax(Model: Model<any>, field: string, query?: Record<string,
102
102
  declare namespace create_d_exports {
103
103
  export { CreateManyFailure, CreateManyPartial, CreateManyPartialError, create, createDefault, createMany, isCreateManyPartialError, upsert };
104
104
  }
105
+ /** Action options: the repository resolves the write concern once and passes it here. */
106
+ type ActionCreateOptions = CreateOptions & {
107
+ queryOptions?: ResolvedQueryOptions;
108
+ };
105
109
  /**
106
110
  * Create single document
107
111
  */
108
- declare function create<TDoc = AnyDocument>(Model: Model<TDoc>, data: Record<string, unknown>, options?: CreateOptions): Promise<TDoc>;
112
+ declare function create<TDoc = AnyDocument>(Model: Model<TDoc>, data: Record<string, unknown>, options?: ActionCreateOptions): Promise<TDoc>;
109
113
  /**
110
114
  * One rejected input, keyed by its position in the array that was passed in.
111
115
  *
@@ -159,7 +163,7 @@ declare function isCreateManyPartialError<TDoc = AnyDocument>(err: unknown): err
159
163
  * `failed`, or to reconcile — and prefer a unique index or an idempotency key
160
164
  * for anything that will be retried automatically.
161
165
  */
162
- declare function createMany<TDoc = AnyDocument>(Model: Model<TDoc>, dataArray: Record<string, unknown>[], options?: CreateOptions): Promise<TDoc[]>;
166
+ declare function createMany<TDoc = AnyDocument>(Model: Model<TDoc>, dataArray: Record<string, unknown>[], options?: ActionCreateOptions): Promise<TDoc[]>;
163
167
  /**
164
168
  * Create with defaults (useful for initialization)
165
169
  */
@@ -181,6 +185,7 @@ declare namespace delete_d_exports {
181
185
  declare function deleteById<TDoc = AnyDocument>(Model: Model<TDoc>, id: string | ObjectId, options?: {
182
186
  session?: unknown;
183
187
  query?: Record<string, unknown>;
188
+ queryOptions?: ResolvedQueryOptions;
184
189
  }): Promise<DeleteResult | null>;
185
190
  /**
186
191
  * Delete many documents. Always returns a {@link DeleteResult} (never
@@ -196,6 +201,7 @@ declare function deleteMany<TDoc = AnyDocument>(Model: Model<TDoc>, query: Recor
196
201
  declare function deleteByQuery(Model: Model<any>, query: Record<string, unknown>, options?: {
197
202
  session?: unknown;
198
203
  throwOnNotFound?: boolean;
204
+ queryOptions?: ResolvedQueryOptions;
199
205
  }): Promise<DeleteResult | null>;
200
206
  /**
201
207
  * Soft delete (set deleted flag). Returns `null` on miss for parity with
@@ -215,6 +221,10 @@ declare function restore<TDoc = AnyDocument>(Model: Model<TDoc>, id: string | Ob
215
221
  declare namespace read_d_exports {
216
222
  export { count, exists, getAll, getById, getByQuery, getOrCreate, tryGetByQuery };
217
223
  }
224
+ /** Action options: the repository resolves time bound / concerns once and passes them here. */
225
+ type ActionReadOptions = OperationOptions & {
226
+ queryOptions?: ResolvedQueryOptions;
227
+ };
218
228
  /**
219
229
  * Get document by ID
220
230
  *
@@ -224,7 +234,7 @@ declare namespace read_d_exports {
224
234
  * @returns Document or null
225
235
  * @throws Error if document not found and throwOnNotFound is true
226
236
  */
227
- declare function getById<TDoc = AnyDocument>(Model: Model<TDoc>, id: string | ObjectId, options?: OperationOptions): Promise<TDoc | null>;
237
+ declare function getById<TDoc = AnyDocument>(Model: Model<TDoc>, id: string | ObjectId, options?: ActionReadOptions): Promise<TDoc | null>;
228
238
  /**
229
239
  * Get document by query
230
240
  *
@@ -234,13 +244,13 @@ declare function getById<TDoc = AnyDocument>(Model: Model<TDoc>, id: string | Ob
234
244
  * @returns Document or null
235
245
  * @throws Error if document not found and throwOnNotFound is true
236
246
  */
237
- declare function getByQuery<TDoc = AnyDocument>(Model: Model<TDoc>, query: Record<string, unknown>, options?: OperationOptions & {
247
+ declare function getByQuery<TDoc = AnyDocument>(Model: Model<TDoc>, query: Record<string, unknown>, options?: ActionReadOptions & {
238
248
  sort?: SortSpec;
239
249
  }): Promise<TDoc | null>;
240
250
  /**
241
251
  * Get document by query without throwing (returns null if not found)
242
252
  */
243
- declare function tryGetByQuery<TDoc = AnyDocument>(Model: Model<TDoc>, query: Record<string, unknown>, options?: Omit<OperationOptions, 'throwOnNotFound'>): Promise<TDoc | null>;
253
+ declare function tryGetByQuery<TDoc = AnyDocument>(Model: Model<TDoc>, query: Record<string, unknown>, options?: Omit<ActionReadOptions, 'throwOnNotFound'>): Promise<TDoc | null>;
244
254
  /**
245
255
  * Get all documents (basic query without pagination)
246
256
  * For pagination, use Repository.paginate() or Repository.stream()
@@ -253,7 +263,7 @@ declare function getAll<TDoc = AnyDocument>(Model: Model<TDoc>, query?: Record<s
253
263
  skip?: number;
254
264
  lean?: boolean;
255
265
  session?: unknown;
256
- readPreference?: ReadPreferenceType;
266
+ queryOptions?: ResolvedQueryOptions;
257
267
  }): Promise<TDoc[]>;
258
268
  /**
259
269
  * Get or create document (atomic upsert).
@@ -282,29 +292,36 @@ declare function getOrCreate<TDoc = AnyDocument>(Model: Model<TDoc>, query: Reco
282
292
  */
283
293
  declare function count<TDoc = AnyDocument>(Model: Model<TDoc>, query?: Record<string, unknown>, options?: {
284
294
  session?: unknown;
285
- readPreference?: ReadPreferenceType;
295
+ queryOptions?: ResolvedQueryOptions;
286
296
  }): Promise<number>;
287
297
  /**
288
298
  * Check if document exists
289
299
  */
290
300
  declare function exists<TDoc = AnyDocument>(Model: Model<TDoc>, query: Record<string, unknown>, options?: {
291
301
  session?: unknown;
292
- readPreference?: ReadPreferenceType;
302
+ queryOptions?: ResolvedQueryOptions;
293
303
  }): Promise<{
294
304
  _id: unknown;
295
305
  } | null>;
296
306
  declare namespace update_d_exports {
297
307
  export { findOneAndUpdate, increment, pullFromArray, pushToArray, update, updateByQuery, updateMany, updateWithConstraints, updateWithValidation };
298
308
  }
309
+ /** Action options: the repository resolves time bound / write concern once and passes them here. */
310
+ type ActionUpdateOptions = UpdateOptions & {
311
+ queryOptions?: ResolvedQueryOptions;
312
+ };
313
+ type ActionFindOneAndUpdateOptions = FindOneAndUpdateOptions & {
314
+ queryOptions?: ResolvedQueryOptions;
315
+ };
299
316
  /**
300
317
  * Update by ID
301
318
  */
302
- declare function update<TDoc = AnyDocument>(Model: Model<TDoc>, id: string | ObjectId, data: Record<string, unknown>, options?: UpdateOptions): Promise<TDoc | null>;
319
+ declare function update<TDoc = AnyDocument>(Model: Model<TDoc>, id: string | ObjectId, data: Record<string, unknown>, options?: ActionUpdateOptions): Promise<TDoc | null>;
303
320
  /**
304
321
  * Update with query constraints (optimized)
305
322
  * Returns null if constraints not met (not an error)
306
323
  */
307
- declare function updateWithConstraints<TDoc = AnyDocument>(Model: Model<TDoc>, id: string | ObjectId, data: Record<string, unknown>, constraints?: Record<string, unknown>, options?: UpdateOptions): Promise<TDoc | null>;
324
+ declare function updateWithConstraints<TDoc = AnyDocument>(Model: Model<TDoc>, id: string | ObjectId, data: Record<string, unknown>, constraints?: Record<string, unknown>, options?: ActionUpdateOptions): Promise<TDoc | null>;
308
325
  /**
309
326
  * Validation options for smart update
310
327
  */
@@ -323,7 +340,7 @@ interface ValidationOptions {
323
340
  * Update with validation (smart optimization)
324
341
  * 1-query on success, 2-queries for detailed errors
325
342
  */
326
- declare function updateWithValidation<TDoc = AnyDocument>(Model: Model<TDoc>, id: string | ObjectId, data: Record<string, unknown>, validationOptions?: ValidationOptions, options?: UpdateOptions): Promise<UpdateWithValidationResult<TDoc>>;
343
+ declare function updateWithValidation<TDoc = AnyDocument>(Model: Model<TDoc>, id: string | ObjectId, data: Record<string, unknown>, validationOptions?: ValidationOptions, options?: ActionUpdateOptions): Promise<UpdateWithValidationResult<TDoc>>;
327
344
  /**
328
345
  * Update many documents
329
346
  */
@@ -331,11 +348,12 @@ declare function updateMany(Model: Model<unknown>, query: Record<string, unknown
331
348
  session?: unknown;
332
349
  updatePipeline?: boolean;
333
350
  arrayFilters?: Record<string, unknown>[];
351
+ queryOptions?: ResolvedQueryOptions;
334
352
  }): Promise<UpdateManyResult>;
335
353
  /**
336
354
  * Update by query
337
355
  */
338
- declare function updateByQuery<TDoc = AnyDocument>(Model: Model<TDoc>, query: Record<string, unknown>, data: Record<string, unknown>, options?: UpdateOptions): Promise<TDoc | null>;
356
+ declare function updateByQuery<TDoc = AnyDocument>(Model: Model<TDoc>, query: Record<string, unknown>, data: Record<string, unknown>, options?: ActionUpdateOptions): Promise<TDoc | null>;
339
357
  /**
340
358
  * Atomic findOneAndUpdate primitive.
341
359
  *
@@ -343,19 +361,19 @@ declare function updateByQuery<TDoc = AnyDocument>(Model: Model<TDoc>, query: Re
343
361
  * matches and `upsert` is false. Used by outbox relays, distributed locks,
344
362
  * and workflow semaphores that need compare-and-set in a single round-trip.
345
363
  */
346
- declare function findOneAndUpdate<TDoc = AnyDocument>(Model: Model<TDoc>, filter: Record<string, unknown>, update: Record<string, unknown> | Record<string, unknown>[], options?: FindOneAndUpdateOptions): Promise<TDoc | null>;
364
+ declare function findOneAndUpdate<TDoc = AnyDocument>(Model: Model<TDoc>, filter: Record<string, unknown>, update: Record<string, unknown> | Record<string, unknown>[], options?: ActionFindOneAndUpdateOptions): Promise<TDoc | null>;
347
365
  /**
348
366
  * Increment field
349
367
  */
350
- declare function increment<TDoc = AnyDocument>(Model: Model<TDoc>, id: string | ObjectId, field: string, value?: number, options?: UpdateOptions): Promise<TDoc | null>;
368
+ declare function increment<TDoc = AnyDocument>(Model: Model<TDoc>, id: string | ObjectId, field: string, value?: number, options?: ActionUpdateOptions): Promise<TDoc | null>;
351
369
  /**
352
370
  * Push to array
353
371
  */
354
- declare function pushToArray<TDoc = AnyDocument>(Model: Model<TDoc>, id: string | ObjectId, field: string, value: unknown, options?: UpdateOptions): Promise<TDoc | null>;
372
+ declare function pushToArray<TDoc = AnyDocument>(Model: Model<TDoc>, id: string | ObjectId, field: string, value: unknown, options?: ActionUpdateOptions): Promise<TDoc | null>;
355
373
  /**
356
374
  * Pull from array
357
375
  */
358
- declare function pullFromArray<TDoc = AnyDocument>(Model: Model<TDoc>, id: string | ObjectId, field: string, value: unknown, options?: UpdateOptions): Promise<TDoc | null>;
376
+ declare function pullFromArray<TDoc = AnyDocument>(Model: Model<TDoc>, id: string | ObjectId, field: string, value: unknown, options?: ActionUpdateOptions): Promise<TDoc | null>;
359
377
  declare namespace index_d_exports {
360
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 };
361
379
  }
package/dist/index.d.mts CHANGED
@@ -1,19 +1,22 @@
1
- import { _ as UpdateOptions, a as CreateOptions, b as LookupOptions, c as FindOneAndUpdateOptions, d as LookupPopulateResult, f as MinMaxResult, g as UpdateManyResult, h as SessionOptions, i as ConvenientTransactionOptions, l as GroupResult, m as ReadOptions, n as CacheOperationOptions, p as OperationOptions, r as CacheableOptions, s as DeleteResult, t as AggregateOptions, u as LookupPopulateOptions, v as WithTransactionOptions, y as LookupBuilder } from "./operations-CrRIoc8Z.mjs";
2
- import { _ as PopulateSpec, a as CursorPayload, b as SortDirection, c as MongokitPageExtras, d as ValueType, f as CursorSecret, g as ObjectId, i as CountStrategy, l as OffsetPaginationOptions, m as AnyModel, n as BasePaginationOptions, o as DecodedCursor, p as AnyDocument, r as CollationOptions, s as KeysetPaginationOptions, t as AggregatePaginationOptions, u as PaginationConfig, v as ReadPreferenceType, x as SortSpec$1, y as SelectSpec } from "./pagination-BpIv2bdS.mjs";
3
- import { a as CreateManyFailure, l as isCreateManyPartialError, o as CreateManyPartial, s as CreateManyPartialError, t as index_d_exports } from "./index-CmjNyulu.mjs";
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
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 { S as RepositoryPluginName, _ as RepositoryOptions, a as HookMode, b as MONGOKIT_PLUGIN_NAMES, 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 UserContext, x as MongoKitPluginName, y as WithPlugins } from "./repository-ZbLtL7Nk.mjs";
6
- import { A as ensureAuditTrailReady, C as AuditTrailMethods, D as AuditTrailQueryOptions, E as AuditTrailQuery, O as EnsureAuditTrailReadyOptions, S as AuditQueryResult, T as AuditTrailOptions, _ as RepositoryCachePluginOptions, a as DateSequentialIdOptions, b as AuditOperation, c as SequentialIdOptions, d as getNextSequence, f as prefixedId, g as RepositoryCacheHandle, h as CacheOptions, i as CustomIdOptions, k as auditTrailPlugin, l as customIdPlugin, m as CacheAdapter, n as adminBypass, o as IdGenerator, p as sequentialId, r as multiTenantPlugin, s as PrefixedIdOptions, t as MultiTenantOptions, u as dateSequentialId, v as cachePlugin, w as AuditTrailMode, x as AuditQueryOptions, y as AuditEntry } from "./multi-tenant.plugin-B-tzNeYL.mjs";
7
- import { t as PaginationEngine } from "./PaginationEngine-D-P19Y9m.mjs";
8
- import { a as AggregationPlan, c as SortOrder, i as AggregationBuilder, l as SortSpec, n as Repository, o as GroupSpec, r as TransitionMachine, s as ProjectionSpec, t as HOOK_PRIORITY, u as VectorSearchOptions } from "./Repository-IxI983_m.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-BuvtOSZf.mjs";
10
- import { n as CreateRepositoryConfig, r as createRepository, t as AuditConfig } from "./create-repository-CRXjDa3N.mjs";
11
- import { A as IdempotencyStoreMethods, B as auditLogPlugin, C as LeaseMethods, D as ImmutableStatesPluginOptions, E as ImmutableClaimView, F as elasticSearchPlugin, H as appendOnlyPlugin, I as cascadePlugin, L as BatchOperationsMethods, M as idempotencyStorePlugin, N as fieldFilterPlugin, O as immutableStatesPlugin, P as ElasticSearchOptions, R as BulkWriteResult, S as methodRegistryPlugin, T as leasePlugin, U as AggregateHelpersMethods, V as AppendOnlyPluginOptions, W as aggregateHelpersPlugin, _ as OperationMetric, a as requireField, b as mongoOperationsPlugin, c as timestampPlugin, d as createTenantContext, f as SubdocumentMethods, g as ObservabilityOptions, h as softDeletePlugin, i as immutableField, j as IdempotencyStorePluginOptions, k as IdempotencyClaim, l as TenantContext, m as SoftDeleteMethods, n as autoInject, o as uniqueField, p as subdocumentPlugin, r as blockIf, s as validationChainPlugin, t as OperationType, u as TenantStore, v as observabilityPlugin, w as LeasePluginOptions, y as MongoOperationsMethods, z as batchOperationsPlugin } from "./validation-chain.plugin-DvrLJIbJ.mjs";
5
+ import { S as RepositoryPluginName, _ as RepositoryOptions, a as HookMode, b as MONGOKIT_PLUGIN_NAMES, 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 UserContext, x as MongoKitPluginName, y as WithPlugins } from "./repository-DNHfjAZX.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-a3UhQARj.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-pnLw1rG5.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-CRhIvSzx.mjs";
10
+ import { n as CreateRepositoryConfig, r as createRepository, t as AuditConfig } from "./create-repository-BUx9vfG9.mjs";
11
+ import { A as IdempotencyStoreMethods, B as batchOperationsPlugin, C as LeaseMethods, D as ImmutableStatesPluginOptions, E as ImmutableClaimView, F as elasticSearchPlugin, G as aggregateHelpersPlugin, H as AppendOnlyPluginOptions, I as cascadePlugin, L as BatchOperationsMethods, M as idempotencyStorePlugin, N as fieldFilterPlugin, O as immutableStatesPlugin, P as ElasticSearchOptions, R as BulkWriteOptions, S as methodRegistryPlugin, T as leasePlugin, U as appendOnlyPlugin, V as auditLogPlugin, W as AggregateHelpersMethods, _ as OperationMetric, a as requireField, b as mongoOperationsPlugin, c as timestampPlugin, d as createTenantContext, f as SubdocumentMethods, g as ObservabilityOptions, h as softDeletePlugin, i as immutableField, j as IdempotencyStorePluginOptions, k as IdempotencyClaim, l as TenantContext, m as SoftDeleteMethods, n as autoInject, o as uniqueField, p as subdocumentPlugin, r as blockIf, s as validationChainPlugin, t as OperationType, u as TenantStore, v as observabilityPlugin, w as LeasePluginOptions, y as MongoOperationsMethods, z as BulkWriteResult } from "./validation-chain.plugin-CTcNJCmV.mjs";
12
12
  import { n as SchemaPathsLike, t as FieldType$1 } from "./coercion-BjdPX3YF.mjs";
13
13
  import { n as SchemaIndexes } from "./indexes-DIjMpYES.mjs";
14
- 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-B8ufk3Qz.mjs";
14
+ 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-CjgEInWV.mjs";
15
15
  import { RepoCapabilities } from "@classytic/repo-core/repository";
16
16
  import { ClientSession, Connection, Model, PipelineStage, Schema } from "mongoose";
17
+ import { HttpError } from "@classytic/repo-core/errors";
18
+ import { KeysetSource } from "@classytic/repo-core/pagination";
19
+ import "@classytic/repo-core/query-parser";
17
20
  //#region src/actions/cascade-references.d.ts
18
21
  type PurgeMode = 'hard' | 'soft' | 'anonymize';
19
22
  /** Raw collection surface — a native MongoDB `Collection` or a Mongoose `Model`. */
@@ -430,6 +433,10 @@ interface PaginationDefaults {
430
433
  cursorSecret?: CursorSecret;
431
434
  /** See {@link PaginationConfig.defaultMode}. */
432
435
  defaultMode?: 'offset' | 'keyset';
436
+ /** See {@link PaginationConfig.maxOffset}: the deployment's deep-offset guard. */
437
+ maxOffset?: number;
438
+ /** See {@link PaginationConfig.countCacheTtlMs}. */
439
+ countCacheTtlMs?: number;
433
440
  /**
434
441
  * See {@link PaginationConfig.maxPage}.
435
442
  *
@@ -460,6 +467,22 @@ declare function getPaginationDefaults(): Readonly<PaginationDefaults>;
460
467
  /** Back to library defaults. For tests — a global that cannot be reset is a leak between them. */
461
468
  declare function resetPaginationDefaults(): void;
462
469
  //#endregion
470
+ //#region src/pagination/keyset-source.d.ts
471
+ interface KeysetSourceOptions extends ReadOptions {
472
+ name: string;
473
+ sort: SortSpec$1;
474
+ filters?: Record<string, unknown>;
475
+ }
476
+ declare function keysetSource<TDoc>(repo: Repository<TDoc>, options: KeysetSourceOptions): KeysetSource<TDoc>;
477
+ //#endregion
478
+ //#region src/pagination/utils/guards.d.ts
479
+ declare const PAGINATION_ERROR_CODES: {
480
+ readonly OFFSET_TOO_DEEP: "mongokit.pagination.offset_too_deep";
481
+ /** repo-core's shared cursor vocabulary (one code set across kits and merged cursors). */
482
+ readonly CURSOR_INVALID: "repo.cursor.invalid";
483
+ readonly CURSOR_SCOPE_MISMATCH: "repo.cursor.scope_mismatch";
484
+ };
485
+ //#endregion
463
486
  //#region src/query/parser/types.d.ts
464
487
  type SortSpec$2 = Record<string, 1 | -1>;
465
488
  type FilterQuery = Record<string, unknown>;
@@ -507,6 +530,10 @@ interface ParsedQuery {
507
530
  page?: number;
508
531
  /** Cursor for keyset pagination */
509
532
  after?: string;
533
+ /** Keyset cursor for the previous page (never with `after`). */
534
+ before?: string;
535
+ /** Explicit paging mode, when the caller named one. */
536
+ mode?: 'offset' | 'keyset';
510
537
  /** Limit */
511
538
  limit: number;
512
539
  /** Full-text search query */
@@ -712,6 +739,20 @@ declare class QueryParser {
712
739
  };
713
740
  }
714
741
  //#endregion
742
+ //#region src/repository/join-scope.d.ts
743
+ /** Returns the predicate a read of the owning collection carries for this call, or none. */
744
+ type CollectionScopeRule = (context: RepositoryContext, operation: string) => Record<string, unknown> | undefined;
745
+ declare const JOIN_ERROR_CODES: {
746
+ readonly UNKNOWN_COLLECTION: "mongokit.join.unknown_collection";
747
+ readonly UNGOVERNED_COLLECTION: "mongokit.join.ungoverned_collection";
748
+ readonly UNSCOPE_REFUSED: "mongokit.join.unscope_refused";
749
+ readonly UNRESOLVABLE_FROM: "mongokit.join.unresolvable_from";
750
+ };
751
+ /** Called by a policy plugin at bind: reads of this model's collection carry `rule`. */
752
+ declare function declareCollectionScope(model: object, rule: CollectionScopeRule, meta?: {
753
+ tenantField?: string;
754
+ }): void;
755
+ //#endregion
715
756
  //#region src/transaction.d.ts
716
757
  /** Minimal shape we need from a Mongoose connection. */
717
758
  interface SessionStarter {
@@ -720,9 +761,9 @@ interface SessionStarter {
720
761
  /**
721
762
  * Run a callback inside a MongoDB transaction on the given connection.
722
763
  *
723
- * - Starts a session, runs `session.withTransaction(callback)` (which auto-retries
724
- * on `TransientTransactionError` and `UnknownTransactionCommitResult`), and
725
- * always ends the session in `finally`.
764
+ * - Starts a session and runs the callback in a transaction with the driver's retry rules
765
+ * (`TransientTransactionError` → retry the attempt, `UnknownTransactionCommitResult` → retry
766
+ * the commit), ending the session in `finally`. See {@link runTransaction}.
726
767
  * - When `allowFallback` is true and the deployment doesn't support transactions
727
768
  * (e.g. standalone MongoDB in dev), the callback runs once without a
728
769
  * transaction on the same session. `onFallback` is invoked with the original
@@ -837,6 +878,35 @@ declare function isTransactionUnsupported(error: Error): boolean;
837
878
  */
838
879
  declare function supportsTransactions(connection: unknown): boolean;
839
880
  //#endregion
881
+ //#region src/utils/scope.d.ts
882
+ /** The fields that decide whose rows an operation touches, and inside which transaction. */
883
+ interface RepoScope {
884
+ /** Platform-admin escape hatch. Present only when the source carried no tenant. */
885
+ bypassTenant?: true;
886
+ session?: ClientSession;
887
+ user?: unknown;
888
+ userId?: unknown;
889
+ requestId?: unknown;
890
+ /** Tenant values, keyed by each declared tenant context key (`organizationId`, …). */
891
+ [tenantKey: string]: unknown;
892
+ }
893
+ /**
894
+ * Record that `repo` resolves its tenant from `contextKey`. Called by
895
+ * `multiTenantPlugin` at bind, so forwarding knows a custom key (`branchId`)
896
+ * without the host restating it.
897
+ */
898
+ declare function declareTenantContextKey(repo: object, contextKey: string): void;
899
+ /** Every tenant context key relevant to a call spanning these repositories. */
900
+ declare function tenantContextKeysOf(...repos: ReadonlyArray<object | undefined>): string[];
901
+ /**
902
+ * The scope to hand a second repository call made on behalf of `source`
903
+ * (a hook's `RepositoryContext`, or a host's request context).
904
+ *
905
+ * Absent values are omitted, never written as `undefined`, so spreading the
906
+ * result into an options bag cannot erase a value set there.
907
+ */
908
+ declare function forwardScope(source: Record<string, unknown> | null | undefined, tenantKeys?: readonly string[]): RepoScope;
909
+ //#endregion
840
910
  //#region src/utils/repo-options.d.ts
841
911
  /**
842
912
  * Forward request-scoped context fields into a mongokit options bag.
@@ -883,23 +953,20 @@ declare function supportsTransactions(connection: unknown): boolean;
883
953
  * });
884
954
  * ```
885
955
  *
886
- * The fields read (all optional — extracted only when present and not
887
- * `undefined`):
888
- *
889
- * - `organizationId` — multi-tenant scope key. The
890
- * `multiTenantPlugin` casts to `ObjectId` automatically when
891
- * configured with `fieldType: 'objectId'`; do NOT pre-cast.
892
- * - `userId` / `user` — audit attribution (audit-log + audit-trail
893
- * plugins read these for the `who` column).
894
- * - `session` — mongoose `ClientSession` for transaction threading.
895
- * - `requestId` — observability correlation id.
896
- *
897
- * Fields beyond this set should be added inline at the call site —
898
- * `repoOptionsFromCtx` deliberately stays narrow so adding a new
899
- * convention to the canonical set is a deliberate API decision, not
900
- * a quiet drift.
956
+ * It is `forwardScope` (see `./scope.ts`), the same rule every internal
957
+ * hop uses, so a request context and a cascade forward identically:
958
+ *
959
+ * - the tenant (`organizationId`, `tenantId`) — `multiTenantPlugin` casts
960
+ * to `ObjectId` itself when configured with `fieldType: 'objectId'`;
961
+ * do NOT pre-cast;
962
+ * - `bypassTenant`, only when literally `true` AND no tenant is present
963
+ * (the tenant plugin honours a bypass before a tenant, so carrying both
964
+ * would widen a scoped call to every tenant);
965
+ * - `session`, and `user` / `userId` / `requestId` for attribution.
966
+ *
967
+ * Domain fields beyond this set belong to `createOptionsExtractor`.
901
968
  */
902
- declare function repoOptionsFromCtx<TCtx extends Record<string, unknown>>(ctx: TCtx | undefined | null): Record<string, unknown>;
969
+ declare function repoOptionsFromCtx<TCtx extends Record<string, unknown>>(ctx: TCtx | undefined | null): RepoScope;
903
970
  /**
904
971
  * Build a typed extractor for **consumer-defined** ctx → options
905
972
  * forwarding. Same conceptual shape as `repoOptionsFromCtx`, but the
@@ -920,12 +987,11 @@ declare function repoOptionsFromCtx<TCtx extends Record<string, unknown>>(ctx: T
920
987
  * output keys are inferred from the input field tuple — you can
921
988
  * destructure with full autocomplete.
922
989
  *
923
- * **Difference from `repoOptionsFromCtx`.** That helper hardcodes the
924
- * fields **mongokit's bundled plugins** read (`organizationId`,
925
- * `userId`, `user`, `session`, `requestId`). Use it when those are
926
- * sufficient. Reach for `createOptionsExtractor` when your domain has
927
- * its own canonical fields (`actorRef`, `actorKind`, `correlationId`,
928
- * `idempotencyKey`, `sagaRunId`, ...) that should also forward.
990
+ * **Scope is always included, and never from `fields`.** The extractor
991
+ * returns `forwardScope(ctx)` plus the declared DOMAIN fields. Listing a
992
+ * scope key (`organizationId`, `bypassTenant`, `session`, …) in `fields`
993
+ * changes nothing: those follow the one scope rule, so an extractor cannot
994
+ * forget the bypass, or carry a bypass beside a tenant.
929
995
  *
930
996
  * @example Per-package canonical extractor
931
997
  * ```ts
@@ -940,12 +1006,12 @@ declare function repoOptionsFromCtx<TCtx extends Record<string, unknown>>(ctx: T
940
1006
  * idempotencyKey?: string;
941
1007
  * };
942
1008
  *
1009
+ * // Domain fields only: the scope (organizationId, session, bypass) is
1010
+ * // always included by the one scope rule.
943
1011
  * export const repoOptionsFromCtx = createOptionsExtractor<CommissionCtx>([
944
- * 'organizationId',
945
1012
  * 'actorRef',
946
1013
  * 'actorKind',
947
1014
  * 'correlationId',
948
- * 'session',
949
1015
  * 'idempotencyKey',
950
1016
  * ]);
951
1017
  *
@@ -1036,4 +1102,4 @@ declare function createOptionsExtractor<TCtx extends Record<string, unknown>>(fi
1036
1102
  */
1037
1103
  declare function systemContext(extra?: SessionOptions): SessionOptions;
1038
1104
  //#endregion
1039
- export { ALL_OPERATIONS, 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 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 ConvenientTransactionOptions, type CountStrategy, type CreateErrorOptions, type CreateInput, type CreateManyFailure, type CreateManyPartial, type CreateManyPartialError, type CreateOptions, type CreateRepositoryConfig, type CrudSchemasFramework, type CursorPayload, type CursorSecret, type CustomIdOptions, 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 GroupResult, type GroupSpec, HOOK_PRIORITY, type HookMode, type IdGenerator, type IdempotencyClaim, type IdempotencyStoreMethods, type IdempotencyStorePluginOptions, type ImmutableClaimView, type ImmutableStatesPluginOptions, type InferDocument, type InferRawDoc, type KeysOfType, type KeysetPaginationOptions, type LeaseMethods, type LeasePluginOptions, type Logger, type LoggerConfig, LookupBuilder, type LookupOptions, type LookupPopulateOptions, type LookupPopulateResult, 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, type PaginationConfig, type PaginationDefaults, PaginationEngine, type ParseDuplicateKeyOptions, type ParsedQuery, type PartialBy, type Plugin, type PluginFunction, type PluginType, type PolicyKey, type PopulateOption, type PopulateSpec, type PrefixedIdOptions, type PrioritizedHook, type ProjectionSpec, type PurgeMode, type PurgeableRepoLike, QueryParser, type QueryParserOptions, type QuerySchema, READ_OPERATIONS, type ReadOptions, type ReadPreferenceType, type ReferencePurgeResult, type ReferenceRelation, Repository, Repository as default, type RepositoryCacheHandle, type RepositoryCachePluginOptions, type RepositoryContext, type RepositoryEvent, type RepositoryInstance, type RepositoryOperation, type RepositoryOptions, type RepositoryPluginName, type RequiredBy, type SchemaLike, 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, 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, index_d_exports as actions, adminBypass, aggregateHelpersPlugin, appendOnlyPlugin, auditLogPlugin, auditTrailPlugin, autoInject, batchOperationsPlugin, batchTransaction, blockIf, buildCrudSchemasFromModel, buildCrudSchemasFromMongooseSchema, cachePlugin, capabilitiesForSupport, cascadePlugin, cascadePurgeReferences, classifyHelloReply, compileFilterToMongo, configureLogger, configurePaginationDefaults, createError, createFieldPreset, createMemoryCache, createOptionsExtractor, createRepository, createTenantContext, customIdPlugin, dateSequentialId, defineModel, defineModels, elasticSearchPlugin, ensureAuditTrailReady, fieldFilterPlugin, filterResponseData, getFieldsForUser, getMongooseProjection, getNextSequence, getPaginationDefaults, idVariants, idempotencyStorePlugin, immutableField, immutableStatesPlugin, isCreateManyPartialError, isDuplicateKeyError, isModelRegistered, isTransactionUnsupported, leasePlugin, methodRegistryPlugin, mongoOperationsPlugin, multiTenantPlugin, observabilityPlugin, operationsByPolicyKey, parseDuplicateKeyError, prefixedId, probeMongoCapabilities, repoOptionsFromCtx, requireField, resetCapabilityProbeCache, resetPaginationDefaults, resolveMongoCapabilities, resolveTransactionSupport, sequentialId, softDeletePlugin, subdocumentPlugin, supportsTransactions, systemContext, timestampPlugin, toPlain, transactionResolutionOf, uniqueField, validationChainPlugin, withTransaction };
1105
+ 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, 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, 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 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 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 RequiredBy, type ResolvedQueryOptions, type SchemaLike, 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, 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, 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, forwardScope, getFieldsForUser, getMongooseProjection, getNextSequence, getPaginationDefaults, getQueryDefaults, idVariants, idempotencyStorePlugin, immutableField, immutableStatesPlugin, isCreateManyPartialError, isDuplicateKeyError, isModelRegistered, isTransactionUnsupported, keysetSource, leasePlugin, methodRegistryPlugin, mongoOperationsPlugin, multiTenantPlugin, observabilityPlugin, operationsByPolicyKey, parseDuplicateKeyError, prefixedId, probeMongoCapabilities, readSequence, repoOptionsFromCtx, requireField, resetCapabilityProbeCache, resetPaginationDefaults, resetQueryDefaults, resolveMongoCapabilities, resolveQueryOptions, resolveTransactionSupport, sequentialId, softDeletePlugin, subdocumentPlugin, supportsTransactions, systemContext, tenantContextKeysOf, timestampPlugin, toPlain, transactionResolutionOf, uniqueField, validationChainPlugin, withTransaction };