@classytic/mongokit 3.43.0 → 3.44.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 +14 -0
  2. package/dist/{PaginationEngine-DZnkbSrr.mjs → PaginationEngine-C9iS0U5l.mjs} +13 -27
  3. package/dist/{PaginationEngine-CRHyuUtw.d.mts → PaginationEngine-D17AthKw.d.mts} +1 -3
  4. package/dist/{Repository-DnL4xk5w.d.mts → Repository-B6oL6OMv.d.mts} +33 -11
  5. package/dist/{Repository-Dj6xqPxJ.mjs → Repository-eMRYZ_2Y.mjs} +204 -92
  6. package/dist/actions/index.d.mts +1 -1
  7. package/dist/actions/index.mjs +2 -12
  8. package/dist/actions-DExyXMTy.mjs +11 -0
  9. package/dist/adapter/index.d.mts +6 -10
  10. package/dist/adapter/index.mjs +1 -2
  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 +18 -32
  15. package/dist/better-auth/index.mjs +3 -4
  16. package/dist/{coercion-BjdPX3YF.d.mts → coercion-COp9DRNw.d.mts} +0 -2
  17. package/dist/{create-repository-CJtVdwig.d.mts → create-repository-BOFUYj1l.d.mts} +5 -7
  18. package/dist/{create-repository-UjwPWR1z.mjs → create-repository-D7MQpIZo.mjs} +4 -5
  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-8QUEsOFI.d.mts} +3 -4
  27. package/dist/{index-C0AjVqX3.d.mts → index-ehGZLbrd.d.mts} +2 -8
  28. package/dist/index.d.mts +63 -96
  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-CGAepsBU.mjs} +3 -5
  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-DfeDMiI8.d.mts} +143 -11
  43. package/dist/{operations-XiFgG5US.d.mts → operations-Dw9OFV0V.d.mts} +14 -5
  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 -2
  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-DAUg5zOY.d.mts} +2 -10
  51. package/dist/{plugin-options-Cirmb4Kp.d.mts → plugin-options-Bpcuz9kS.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-aUoKlEbh.mjs} +2 -3
  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-DzVIwhU2.d.mts} +25 -29
  64. package/dist/retention-purge-DqcYvRnG.d.mts +35 -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 -2
  68. package/dist/sync/index.d.mts +95 -15
  69. package/dist/sync/index.mjs +308 -62
  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-Bz_zL9PX.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-PO5r1Qoy.d.mts} +2 -16
  77. package/dist/{transaction-DmiB4k2P.mjs → transaction-C2PFxfIv.mjs} +5 -8
  78. package/dist/{type-utils-CLzRFtIA.d.mts → type-utils-CKvuewAL.d.mts} +0 -2
  79. package/dist/{update-WgeAUJ_I.mjs → update-DcfmNbJe.mjs} +12 -20
  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-B3gZCZj4.d.mts} +135 -48
  85. package/dist/{validation-chain.plugin-DRApTmkN.mjs → validation-chain.plugin-DNY6MIF6.mjs} +207 -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 +102 -0
  91. package/skills/mongokit/references/repository-api.md +83 -0
  92. package/skills/mongokit/references/transactions-outbox.md +101 -0
@@ -1,8 +1,7 @@
1
- import { A as ObjectId, F as SortSpec, M as ReadPreferenceType, N as SelectSpec, b as WriteConcernSpec, i as CountStrategy, j as PopulateSpec, r as CollationOptions, v as ReadConcernLevel } from "./pagination-D6psses0.mjs";
1
+ import { A as ObjectId, F as SortSpec, M as ReadPreferenceType, N as SelectSpec, b as WriteConcernSpec, i as CountStrategy, j as PopulateSpec, r as CollationOptions, v as ReadConcernLevel } from "./pagination-DAUg5zOY.mjs";
2
2
  import { DeleteManyResult, DeleteResult, LookupPopulateResult, UpdateManyResult } from "@classytic/repo-core/repository";
3
3
  import { PipelineStage, PopulateOptions } from "mongoose";
4
4
  import { Filter } from "@classytic/repo-core/filter";
5
- //#region src/query/LookupBuilder.d.ts
6
5
  interface LookupOptions {
7
6
  /** Collection to join with */
8
7
  from: string;
@@ -238,8 +237,6 @@ declare class LookupBuilder {
238
237
  * - For read-heavy workloads: Consider caching or materialized views
239
238
  * - For real-time dashboards: Consider separate aggregation collections
240
239
  */
241
- //#endregion
242
- //#region src/types/operations.d.ts
243
240
  /** Session-only options — shared base for lightweight operations */
244
241
  interface SessionOptions {
245
242
  /** MongoDB session for transactions */
@@ -312,6 +309,19 @@ interface SessionOptions {
312
309
  * substitute for access control — gate it at the host layer.
313
310
  */
314
311
  bypassAppendOnly?: boolean;
312
+ /**
313
+ * Audited retention purge, the one public path past the integrity fences:
314
+ * on `delete` / `deleteMany` with `mode: 'hard'`, `appendOnlyPlugin` and
315
+ * `immutableStatesPlugin` built with `allowPurge: true` let this call
316
+ * through and emit `after:append-only-purge` /
317
+ * `after:immutable-states-purge`. `reason` is required. Ignored by every
318
+ * other op (rows never become editable through it). `purgeByFilter` /
319
+ * `purgeByField` take the same option and forward it to each chunk.
320
+ */
321
+ retentionPurge?: {
322
+ reason: string;
323
+ actor?: string | undefined;
324
+ };
315
325
  /** Write concern for this call; beats `queryDefaults.writeConcern`. Ignored by reads. */
316
326
  writeConcern?: WriteConcernSpec;
317
327
  /** Extensible — plugins can read custom fields from options */
@@ -555,5 +565,4 @@ interface GetByIdsOptions extends OperationOptions {
555
565
  /** Return `Array<TDoc | undefined>` aligned with the input ids instead of a Map. */
556
566
  preserveOrder?: boolean;
557
567
  }
558
- //#endregion
559
568
  export { LookupOptions as S, SessionOptions as _, ConvenientTransactionOptions as a, WithTransactionOptions as b, DeleteResult as c, GroupResult as d, LookupPopulateOptions as f, ReadOptions as g, OperationOptions as h, CacheableOptions as i, FindOneAndUpdateOptions as l, MinMaxResult as m, AggregateOptions as n, CreateOptions as o, LookupPopulateResult as p, CacheOperationOptions as r, DeleteManyResult as s, AggregateCallOptions as t, GetByIdsOptions as u, UpdateManyResult as v, LookupBuilder as x, UpdateOptions as y };
@@ -1,9 +1,9 @@
1
- import { r as Repository } from "../Repository-DnL4xk5w.mjs";
1
+ import { r as Repository } from "../Repository-B6oL6OMv.mjs";
2
+ import { u as PaginationConfig } from "../pagination-DAUg5zOY.mjs";
2
3
  import { Connection, Model } from "mongoose";
3
- //#region src/outbox/index.d.ts
4
4
  /** Delivery states. `dead_letter` is terminal and operator-visible. */
5
- declare const OUTBOX_STATUSES: readonly ["pending", "delivered", "dead_letter"];
6
- interface OutboxModelOptions {
5
+ export declare const OUTBOX_STATUSES: readonly ['pending', 'delivered', 'dead_letter'];
6
+ export interface OutboxModelOptions {
7
7
  /** Collection name. Default `event_outbox`. */
8
8
  collection?: string;
9
9
  /** Mongoose model name. Default `EventOutbox`. Must be unique per connection. */
@@ -31,7 +31,7 @@ interface OutboxModelOptions {
31
31
  * Idempotent per connection: calling twice returns the same model rather than throwing
32
32
  * `OverwriteModelError`, so a host may build it lazily from several call sites.
33
33
  */
34
- declare function createOutboxModel(connection: Connection, options?: OutboxModelOptions): Model<Record<string, unknown>>;
34
+ export declare function createOutboxModel(connection: Connection, options?: OutboxModelOptions): Model<Record<string, unknown>>;
35
35
  /**
36
36
  * The repository `repositoryAsOutboxStore` needs, with the plugin set it actually calls.
37
37
  *
@@ -55,9 +55,24 @@ declare function createOutboxModel(connection: Connection, options?: OutboxModel
55
55
  *
56
56
  * `plugins` appends to the required set rather than replacing it — for an observability or
57
57
  * cache plugin a deployment wants on this table too.
58
+ *
59
+ * **The caller's `limit` is the bound.** The adapter reads its claim window with
60
+ * `getAll({ limit: batchSize })`. A repository built with the generic pagination default
61
+ * (`maxLimit: 100`) clamps that read silently, so a relay configured for 500 claims 100, sees
62
+ * "fewer than batchSize" and stops its multi-pass drain after one pass. This table is never
63
+ * listed to an HTTP client, and every read the adapter makes names its own limit (the relay's
64
+ * `batchSize`, an admin route's already-bounded `limit`), so the repository defaults to
65
+ * `maxLimit: 0` (no cap). A read with no limit still gets `defaultLimit`. Pass `pagination` to
66
+ * set a ceiling anyway.
58
67
  */
59
- declare function createOutboxRepository(connection: Connection, options?: OutboxModelOptions & {
68
+ export declare function createOutboxRepository(connection: Connection, options?: OutboxRepositoryOptions): Repository<Record<string, unknown>>;
69
+ export interface OutboxRepositoryOptions extends OutboxModelOptions {
70
+ /** Appended to the required plugin set (`methodRegistryPlugin`, `batchOperationsPlugin`). */
60
71
  plugins?: readonly unknown[];
61
- }): Repository<Record<string, unknown>>;
62
- //#endregion
63
- export { OUTBOX_STATUSES, OutboxModelOptions, createOutboxModel, createOutboxRepository };
72
+ /**
73
+ * Pagination config for the repository. Default `{ maxLimit: 0 }`: a read returns as many
74
+ * rows as its `limit` asks for. Set `maxLimit` to cap every read; the relay's `batchSize`
75
+ * must then stay at or below it, or each pass is clamped to the cap.
76
+ */
77
+ pagination?: PaginationConfig;
78
+ }
@@ -1,7 +1,7 @@
1
- import { n as Repository } from "../Repository-Dj6xqPxJ.mjs";
2
- import { n as batchOperationsPlugin, t as methodRegistryPlugin } from "../method-registry.plugin-C63pGn1d.mjs";
1
+ import { n as batchOperationsPlugin, t as methodRegistryPlugin } from "../method-registry.plugin-CGAepsBU.mjs";
2
+ import { n as Repository } from "../Repository-eMRYZ_2Y.mjs";
3
3
  import { Schema } from "mongoose";
4
- //#region src/outbox/index.ts
4
+ // src/outbox/index.ts
5
5
  /**
6
6
  * The mongo-backed OUTBOX table — schema, indexes and repository.
7
7
  *
@@ -228,14 +228,25 @@ function createOutboxModel(connection, options = {}) {
228
228
  *
229
229
  * `plugins` appends to the required set rather than replacing it — for an observability or
230
230
  * cache plugin a deployment wants on this table too.
231
+ *
232
+ * **The caller's `limit` is the bound.** The adapter reads its claim window with
233
+ * `getAll({ limit: batchSize })`. A repository built with the generic pagination default
234
+ * (`maxLimit: 100`) clamps that read silently, so a relay configured for 500 claims 100, sees
235
+ * "fewer than batchSize" and stops its multi-pass drain after one pass. This table is never
236
+ * listed to an HTTP client, and every read the adapter makes names its own limit (the relay's
237
+ * `batchSize`, an admin route's already-bounded `limit`), so the repository defaults to
238
+ * `maxLimit: 0` (no cap). A read with no limit still gets `defaultLimit`. Pass `pagination` to
239
+ * set a ceiling anyway.
231
240
  */
232
241
  function createOutboxRepository(connection, options = {}) {
233
- const { plugins = [], ...modelOptions } = options;
242
+ const { plugins = [], pagination, ...modelOptions } = options;
234
243
  return new Repository(createOutboxModel(connection, modelOptions), [
235
244
  methodRegistryPlugin(),
236
245
  batchOperationsPlugin(),
237
246
  ...plugins
238
- ]);
247
+ ], {
248
+ maxLimit: 0,
249
+ ...pagination
250
+ });
239
251
  }
240
- //#endregion
241
252
  export { OUTBOX_STATUSES, createOutboxModel, createOutboxRepository };
@@ -1,2 +1,2 @@
1
- import { n as PaginationEngine, t as CountMemoKey } from "../PaginationEngine-CRHyuUtw.mjs";
1
+ import { n as PaginationEngine, t as CountMemoKey } from "../PaginationEngine-D17AthKw.mjs";
2
2
  export { CountMemoKey, PaginationEngine };
@@ -1,2 +1 @@
1
- import { t as PaginationEngine } from "../PaginationEngine-DZnkbSrr.mjs";
2
- export { PaginationEngine };
1
+ export { t as PaginationEngine } from "../PaginationEngine-C9iS0U5l.mjs";
@@ -1,5 +1,4 @@
1
- import { u as PaginationConfig } from "../../pagination-D6psses0.mjs";
2
- //#region src/pagination/utils/limits.d.ts
1
+ import { u as PaginationConfig } from "../../pagination-DAUg5zOY.mjs";
3
2
  /**
4
3
  * Validates and sanitizes limit value
5
4
  * Parses strings to numbers and prevents NaN bugs
@@ -8,7 +7,7 @@ import { u as PaginationConfig } from "../../pagination-D6psses0.mjs";
8
7
  * @param config - Pagination configuration
9
8
  * @returns Sanitized limit between 1 and maxLimit
10
9
  */
11
- declare function validateLimit(limit: number | string, config: PaginationConfig): number;
10
+ export declare function validateLimit(limit: number | string, config: PaginationConfig): number;
12
11
  /**
13
12
  * Validates and sanitizes page number
14
13
  * Parses strings to numbers and prevents NaN bugs
@@ -18,7 +17,7 @@ declare function validateLimit(limit: number | string, config: PaginationConfig)
18
17
  * @returns Sanitized page number >= 1
19
18
  * @throws Error if page exceeds maxPage
20
19
  */
21
- declare function validatePage(page: number | string, config: PaginationConfig): number;
20
+ export declare function validatePage(page: number | string, config: PaginationConfig): number;
22
21
  /**
23
22
  * Checks if page number should trigger deep pagination warning
24
23
  *
@@ -26,7 +25,7 @@ declare function validatePage(page: number | string, config: PaginationConfig):
26
25
  * @param threshold - Warning threshold
27
26
  * @returns True if warning should be shown
28
27
  */
29
- declare function shouldWarnDeepPagination(page: number, threshold: number): boolean;
28
+ export declare function shouldWarnDeepPagination(page: number, threshold: number): boolean;
30
29
  /**
31
30
  * Calculates number of documents to skip for offset pagination
32
31
  *
@@ -34,7 +33,7 @@ declare function shouldWarnDeepPagination(page: number, threshold: number): bool
34
33
  * @param limit - Documents per page
35
34
  * @returns Number of documents to skip
36
35
  */
37
- declare function calculateSkip(page: number, limit: number): number;
36
+ export declare function calculateSkip(page: number, limit: number): number;
38
37
  /**
39
38
  * Calculates total number of pages
40
39
  *
@@ -42,6 +41,4 @@ declare function calculateSkip(page: number, limit: number): number;
42
41
  * @param limit - Documents per page
43
42
  * @returns Total number of pages
44
43
  */
45
- declare function calculateTotalPages(total: number, limit: number): number;
46
- //#endregion
47
- export { calculateSkip, calculateTotalPages, shouldWarnDeepPagination, validateLimit, validatePage };
44
+ export declare function calculateTotalPages(total: number, limit: number): number;
@@ -1,5 +1,5 @@
1
- import { t as createError } from "../../error-BuByZwKU.mjs";
2
- //#region src/pagination/utils/limits.ts
1
+ import { t as createError } from "../../error-DjdmPLWO.mjs";
2
+ // src/pagination/utils/limits.ts
3
3
  /**
4
4
  * Validates and sanitizes limit value
5
5
  * Parses strings to numbers and prevents NaN bugs
@@ -81,5 +81,4 @@ function calculateSkip(page, limit) {
81
81
  function calculateTotalPages(total, limit) {
82
82
  return Math.ceil(total / limit);
83
83
  }
84
- //#endregion
85
84
  export { calculateSkip, calculateTotalPages, shouldWarnDeepPagination, validateLimit, validatePage };
@@ -1,5 +1,4 @@
1
1
  import { Connection, Document, Model, PipelineStage, PopulateOptions, Types } from "mongoose";
2
- //#region src/types/core.d.ts
3
2
  /**
4
3
  * Core query/document primitives shared across every mongokit module —
5
4
  * sort/select/populate/filter specs and the mongoose-facing aliases.
@@ -46,8 +45,6 @@ type PopulateSpec = string | string[] | PopulateOptions | PopulateOptions[];
46
45
  type SelectSpec = string | readonly string[] | Record<string, 0 | 1>;
47
46
  /** Filter query type for MongoDB queries (compatible with Mongoose 8 & 9) */
48
47
  type FilterQuery<_T = unknown> = Record<string, unknown>;
49
- //#endregion
50
- //#region src/repository/query-defaults.d.ts
51
48
  type ReadConcernLevel = 'local' | 'available' | 'majority' | 'linearizable' | 'snapshot';
52
49
  interface WriteConcernSpec {
53
50
  w?: number | 'majority';
@@ -110,17 +107,15 @@ declare function assertQueryDefaultsConfigured(connection?: Connection): {
110
107
  timeoutMS?: number;
111
108
  };
112
109
  declare const QUERY_DEFAULTS_ERROR_CODES: {
113
- readonly NOT_CONFIGURED: "mongokit.query_defaults.not_configured";
110
+ readonly NOT_CONFIGURED: 'mongokit.query_defaults.not_configured';
114
111
  /** A per-call bound inside a transaction that carries its own CSOT budget (the driver forbids both). */
115
- readonly TIMEOUT_IN_TRANSACTION: "mongokit.query_defaults.timeout_in_transaction";
112
+ readonly TIMEOUT_IN_TRANSACTION: 'mongokit.query_defaults.timeout_in_transaction';
116
113
  };
117
114
  /** Resolve the options one command runs with. `repo` is the repository's own defaults. */
118
115
  declare function resolveQueryOptions(kind: CommandKind, perCall: PerCallQueryOptions, repo?: {
119
116
  query?: QueryDefaults;
120
117
  aggregate?: AggregateDefaults;
121
118
  }): ResolvedQueryOptions;
122
- //#endregion
123
- //#region src/pagination/utils/cursor-signing.d.ts
124
119
  /**
125
120
  * HMAC signing for pagination cursors.
126
121
  *
@@ -156,8 +151,6 @@ declare function resolveQueryOptions(kind: CommandKind, perCall: PerCallQueryOpt
156
151
  */
157
152
  /** One key, or several during a rotation (the FIRST signs; all verify). */
158
153
  type CursorSecret = string | readonly string[];
159
- //#endregion
160
- //#region src/types/pagination.d.ts
161
154
  /**
162
155
  * How an offset page learns how many rows sit behind it.
163
156
  *
@@ -463,5 +456,4 @@ interface DecodedCursor {
463
456
  /** Scope fingerprint the cursor was minted under. */
464
457
  scope: string;
465
458
  }
466
- //#endregion
467
459
  export { ObjectId as A, configureQueryDefaults as C, AnyDocument as D, resolveQueryOptions as E, SortSpec as F, ReadPreferenceType as M, SelectSpec as N, AnyModel as O, SortDirection as P, configureAggregateDefaults as S, resetQueryDefaults as T, QueryDefaults as _, CursorPayload as a, WriteConcernSpec as b, MongokitPageExtras as c, ValueType as d, CursorSecret as f, QUERY_DEFAULTS_ERROR_CODES as g, PerCallQueryOptions as h, CountStrategy as i, PopulateSpec as j, FilterQuery as k, OffsetPaginationOptions as l, CommandKind as m, BasePaginationOptions as n, DecodedCursor as o, AggregateDefaults as p, CollationOptions as r, KeysetPaginationOptions as s, AggregatePaginationOptions as t, PaginationConfig as u, ReadConcernLevel as v, getQueryDefaults as w, assertQueryDefaultsConfigured as x, ResolvedQueryOptions as y };
@@ -1,7 +1,6 @@
1
- import { A as ObjectId, F as SortSpec, N as SelectSpec, j as PopulateSpec } from "./pagination-D6psses0.mjs";
2
- import { h as RepositoryInstance, p as RepositoryContext } from "./repository-MqAP409e.mjs";
1
+ import { A as ObjectId, F as SortSpec, N as SelectSpec, j as PopulateSpec } from "./pagination-DAUg5zOY.mjs";
2
+ import { h as RepositoryInstance, p as RepositoryContext } from "./repository-DzVIwhU2.mjs";
3
3
  import { OffsetPaginationResult } from "@classytic/repo-core/pagination";
4
- //#region src/types/plugin-options.d.ts
5
4
  /** Field preset configuration (field-filter plugin) */
6
5
  interface FieldPreset {
7
6
  /** Fields visible to everyone */
@@ -165,5 +164,4 @@ interface CascadeOptions {
165
164
  /** Logger for cascade operations */
166
165
  logger?: Logger;
167
166
  }
168
- //#endregion
169
167
  export { SoftDeleteFilterMode as a, ValidationChainOptions as c, Logger as i, ValidatorDefinition as l, CascadeRelation as n, SoftDeleteOptions as o, FieldPreset as r, SoftDeleteRepository as s, CascadeOptions as t };
@@ -1,8 +1,8 @@
1
- import { C as RepositoryPluginName, S as MongoKitPluginName, l as Plugin, x as MONGOKIT_PLUGIN_NAMES } from "../repository-MqAP409e.mjs";
2
- 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, f as getNextSequence, g as CacheAdapter, h as sequentialId, i as CustomIdOptions, j as auditTrailPlugin, k as AuditTrailQueryOptions, l as customIdPlugin, 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";
3
- import { A as immutableStatesPlugin, C as MethodRegistryRepository, 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, 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";
1
+ import { A as ImmutablePurgeEvent, B as elasticSearchPlugin, C as MethodRegistryRepository, 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, V as cascadePlugin, 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-B3gZCZj4.mjs";
2
+ 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, T as sequentialId, V as auditTrailPlugin, _ as customIdPlugin, a as DateSequentialIdOptions, b as getNextPeriodSequence, i as CustomIdOptions, j as AuditEntry, k as RepositoryCachePluginOptions, m as SequentialIdOptions, o as IdGenerator, r as multiTenantPlugin, t as MultiTenantOptions, u as PrefixedIdOptions, v as dateSequentialId, x as getNextSequence, z as AuditTrailQueryOptions } from "../multi-tenant.plugin-DfeDMiI8.mjs";
3
+ import { C as RepositoryPluginName, S as MongoKitPluginName, l as Plugin, x as MONGOKIT_PLUGIN_NAMES } from "../repository-DzVIwhU2.mjs";
4
+ import { n as RetentionPurgeEvent, r as RetentionPurgeRequest, t as RETENTION_PURGE_ERROR_CODES } from "../retention-purge-DqcYvRnG.mjs";
4
5
  import { ChangeLogStore } from "@classytic/repo-core/sync";
5
- //#region src/plugins/change-log.plugin.d.ts
6
6
  interface ChangeLogPluginOptions {
7
7
  /** Durable feed implementing the repo-core/sync contract. */
8
8
  store: ChangeLogStore;
@@ -18,6 +18,5 @@ interface ChangeLogPluginOptions {
18
18
  */
19
19
  project?: (doc: Record<string, unknown>) => Record<string, unknown>;
20
20
  }
21
- declare function changeLogPlugin(options: ChangeLogPluginOptions): Plugin;
22
- //#endregion
23
- export { type AggregateHelpersMethods, type AppendOnlyPluginOptions, type AuditEntry, type AuditOperation, type AuditQueryOptions, type AuditQueryResult, type AuditTrailMethods, type AuditTrailMode, type AuditTrailOptions, AuditTrailQuery, type AuditTrailQueryOptions, type BatchOperationsMethods, type CacheAdapter, type CacheOptions, type ChangeLogPluginOptions, type CustomIdOptions, type DateSequentialIdOptions, type ElasticSearchOptions, type EnsureAuditTrailReadyOptions, type IdGenerator, type IdempotencyClaim, type IdempotencyStoreMethods, type IdempotencyStorePluginOptions, type ImmutableClaimView, type ImmutableStatesPluginOptions, type LeaseMethods, type LeasePluginOptions, MONGOKIT_PLUGIN_NAMES, type MethodRegistryRepository, type MongoKitPluginName, type MongoOperationsMethods, type MultiTenantOptions, type ObservabilityOptions, type OperationMetric, type OperationType, type PrefixedIdOptions, type RepositoryCacheHandle, type RepositoryCachePluginOptions, type RepositoryPluginName, type SearchKeysPluginOptions, type SequentialIdOptions, type SoftDeleteMethods, type SubdocumentMethods, type TenantContext, type TenantStore, aggregateHelpersPlugin, appendOnlyPlugin, auditLogPlugin, auditTrailPlugin, autoInject, batchOperationsPlugin, blockIf, cachePlugin, cascadePlugin, changeLogPlugin, createTenantContext, customIdPlugin, dateSequentialId, elasticSearchPlugin, ensureAuditTrailReady, fieldFilterPlugin, getNextSequence, idempotencyStorePlugin, immutableField, immutableStatesPlugin, leasePlugin, methodRegistryPlugin, mongoOperationsPlugin, multiTenantPlugin, observabilityPlugin, prefixedId, requireField, searchKeysPlugin, sequentialId, softDeletePlugin, subdocumentPlugin, timestampPlugin, uniqueField, validationChainPlugin };
21
+ export declare function changeLogPlugin(options: ChangeLogPluginOptions): Plugin;
22
+ export { type AggregateHelpersMethods, type AppendOnlyPluginOptions, type AppendOnlyPurgeEvent, type AuditEntry, type AuditOperation, type AuditQueryOptions, type AuditQueryResult, type AuditTrailMethods, type AuditTrailMode, type AuditTrailOptions, AuditTrailQuery, type AuditTrailQueryOptions, type BatchOperationsMethods, type CacheAdapter, type CacheOptions, type ChangeLogPluginOptions, type CustomIdOptions, type DateSequentialIdOptions, type ElasticSearchOptions, type EnsureAuditTrailReadyOptions, type IdGenerator, type IdempotencyClaim, type IdempotencyStoreMethods, type IdempotencyStorePluginOptions, type ImmutableClaimView, type ImmutablePurgeEvent, type ImmutablePurgeRequest, type ImmutableStatesPluginOptions, type LeaseMethods, type LeasePendingFilter, type LeasePluginOptions, MONGOKIT_PLUGIN_NAMES, type MethodRegistryRepository, type MongoKitPluginName, type MongoOperationsMethods, type MultiTenantOptions, type ObservabilityOptions, type OperationMetric, type OperationType, type PrefixedIdOptions, RETENTION_PURGE_ERROR_CODES, type RepositoryCacheHandle, type RepositoryCachePluginOptions, type RepositoryPluginName, type RetentionPurgeEvent, type RetentionPurgeRequest, type SearchKeysPluginOptions, type SequentialIdOptions, type SoftDeleteMethods, type SubdocumentMethods, type TenantContext, type TenantStore, aggregateHelpersPlugin, appendOnlyPlugin, auditLogPlugin, auditTrailPlugin, autoInject, batchOperationsPlugin, blockIf, cachePlugin, cascadePlugin, createTenantContext, customIdPlugin, dateSequentialId, elasticSearchPlugin, ensureAuditTrailReady, fieldFilterPlugin, getNextPeriodSequence, getNextSequence, idempotencyStorePlugin, immutableField, immutableStatesPlugin, leasePlugin, methodRegistryPlugin, mongoOperationsPlugin, multiTenantPlugin, observabilityPlugin, prefixedId, requireField, searchKeysPlugin, sequentialId, softDeletePlugin, subdocumentPlugin, timestampPlugin, uniqueField, validationChainPlugin };
@@ -1,8 +1,8 @@
1
- import { i as searchKeysPlugin } from "../Repository-Dj6xqPxJ.mjs";
2
- import { _ as AuditTrailQuery, b as auditLogPlugin, f as getNextSequence, g as cachePlugin, h as sequentialId, i as multiTenantPlugin, l as customIdPlugin, n as softDeletePlugin, p as prefixedId, t as timestampPlugin, u as dateSequentialId, v as auditTrailPlugin, y as ensureAuditTrailReady } from "../timestamp.plugin-DpOWavVI.mjs";
3
- import { n as batchOperationsPlugin, t as methodRegistryPlugin } from "../method-registry.plugin-C63pGn1d.mjs";
4
- import { _ as cascadePlugin, a as uniqueField, c as subdocumentPlugin, d as mongoOperationsPlugin, f as leasePlugin, g as elasticSearchPlugin, h as fieldFilterPlugin, i as requireField, l as observabilityPlugin, m as idempotencyStorePlugin, n as blockIf, o as validationChainPlugin, p as immutableStatesPlugin, r as immutableField, s as createTenantContext, t as autoInject, u as MONGOKIT_PLUGIN_NAMES, v as appendOnlyPlugin, y as aggregateHelpersPlugin } from "../validation-chain.plugin-DRApTmkN.mjs";
5
- //#region src/plugins/change-log.plugin.ts
1
+ import { _ as cascadePlugin, a as uniqueField, c as subdocumentPlugin, d as mongoOperationsPlugin, f as leasePlugin, g as elasticSearchPlugin, h as fieldFilterPlugin, i as requireField, l as observabilityPlugin, m as idempotencyStorePlugin, n as blockIf, o as validationChainPlugin, p as immutableStatesPlugin, r as immutableField, s as createTenantContext, t as autoInject, u as MONGOKIT_PLUGIN_NAMES, v as appendOnlyPlugin, y as aggregateHelpersPlugin } from "../validation-chain.plugin-DNY6MIF6.mjs";
2
+ import { C as ensureAuditTrailReady, S as auditTrailPlugin, _ as prefixedId, b as cachePlugin, d as customIdPlugin, f as dateSequentialId, h as getNextSequence, i as multiTenantPlugin, m as getNextPeriodSequence, n as softDeletePlugin, t as timestampPlugin, w as auditLogPlugin, x as AuditTrailQuery, y as sequentialId } from "../timestamp.plugin-Bz_zL9PX.mjs";
3
+ import { n as batchOperationsPlugin, t as methodRegistryPlugin } from "../method-registry.plugin-CGAepsBU.mjs";
4
+ import { d as RETENTION_PURGE_ERROR_CODES, i as searchKeysPlugin } from "../Repository-eMRYZ_2Y.mjs";
5
+ // src/plugins/change-log.plugin.ts
6
6
  const PLUGIN_NAME = "changeLog";
7
7
  /** Marks a repository already captured: the store and scope it writes to. */
8
8
  const CAPTURED = Symbol.for("mongokit.changeLog.capture");
@@ -175,5 +175,4 @@ function changeLogPlugin(options) {
175
175
  }
176
176
  };
177
177
  }
178
- //#endregion
179
- export { AuditTrailQuery, MONGOKIT_PLUGIN_NAMES, aggregateHelpersPlugin, appendOnlyPlugin, auditLogPlugin, auditTrailPlugin, autoInject, batchOperationsPlugin, blockIf, cachePlugin, cascadePlugin, changeLogPlugin, createTenantContext, customIdPlugin, dateSequentialId, elasticSearchPlugin, ensureAuditTrailReady, fieldFilterPlugin, getNextSequence, idempotencyStorePlugin, immutableField, immutableStatesPlugin, leasePlugin, methodRegistryPlugin, mongoOperationsPlugin, multiTenantPlugin, observabilityPlugin, prefixedId, requireField, searchKeysPlugin, sequentialId, softDeletePlugin, subdocumentPlugin, timestampPlugin, uniqueField, validationChainPlugin };
178
+ export { AuditTrailQuery, MONGOKIT_PLUGIN_NAMES, RETENTION_PURGE_ERROR_CODES, aggregateHelpersPlugin, appendOnlyPlugin, auditLogPlugin, auditTrailPlugin, autoInject, batchOperationsPlugin, blockIf, cachePlugin, cascadePlugin, changeLogPlugin, createTenantContext, customIdPlugin, dateSequentialId, elasticSearchPlugin, ensureAuditTrailReady, fieldFilterPlugin, getNextPeriodSequence, getNextSequence, idempotencyStorePlugin, immutableField, immutableStatesPlugin, leasePlugin, methodRegistryPlugin, mongoOperationsPlugin, multiTenantPlugin, observabilityPlugin, prefixedId, requireField, searchKeysPlugin, sequentialId, softDeletePlugin, subdocumentPlugin, timestampPlugin, uniqueField, validationChainPlugin };
@@ -1,2 +1,2 @@
1
- import { a as coerceHeuristic, i as coerceFieldValue, n as SchemaPathsLike, o as coerceToType, r as buildFieldTypeMap, s as normalizeMongooseType, t as FieldType } from "../../coercion-BjdPX3YF.mjs";
1
+ import { a as coerceHeuristic, i as coerceFieldValue, n as SchemaPathsLike, o as coerceToType, r as buildFieldTypeMap, s as normalizeMongooseType, t as FieldType } from "../../coercion-COp9DRNw.mjs";
2
2
  export { FieldType, SchemaPathsLike, buildFieldTypeMap, coerceFieldValue, coerceHeuristic, coerceToType, normalizeMongooseType };
@@ -1,6 +1,6 @@
1
- import { r as isObjectIdInstance } from "../../id-resolution-BqDrk0S2.mjs";
1
+ import { r as isObjectIdInstance } from "../../id-resolution-Cqh49d9J.mjs";
2
2
  import mongoose from "mongoose";
3
- //#region src/query/primitives/coercion.ts
3
+ // src/query/primitives/coercion.ts
4
4
  /**
5
5
  * Value coercion primitives
6
6
  *
@@ -144,5 +144,4 @@ function coerceFieldValue(field, value, types) {
144
144
  if (!type) return coerceHeuristic(value);
145
145
  return coerceToType(value, type);
146
146
  }
147
- //#endregion
148
147
  export { buildFieldTypeMap, coerceFieldValue, coerceHeuristic, coerceToType, normalizeMongooseType };
@@ -1,4 +1,3 @@
1
- //#region src/query/primitives/geo.d.ts
2
1
  /**
3
2
  * Geo query primitives
4
3
  *
@@ -14,21 +13,21 @@
14
13
  * `[nearSphere]`, or `[geoWithin]` operator on a field.
15
14
  */
16
15
  /** Geo operators recognized by the parser */
17
- declare const GEO_OPERATORS: readonly ["near", "nearSphere", "geoWithin", "withinRadius"];
18
- type GeoOperator = (typeof GEO_OPERATORS)[number];
16
+ export declare const GEO_OPERATORS: readonly ['near', 'nearSphere', 'geoWithin', 'withinRadius'];
17
+ export type GeoOperator = (typeof GEO_OPERATORS)[number];
19
18
  /**
20
19
  * True iff `operator` is one of the geo operators we handle.
21
20
  * Used by the operator router in QueryParser to short-circuit before the
22
21
  * generic numeric/string operator handling kicks in.
23
22
  */
24
- declare function isGeoOperator(operator: string): operator is GeoOperator;
23
+ export declare function isGeoOperator(operator: string): operator is GeoOperator;
25
24
  /**
26
25
  * Parse a comma-separated coordinate list into numbers, validating each value
27
26
  * is a finite number. Returns null on any parse failure — callers must treat
28
27
  * null as "drop this filter entirely" rather than substituting defaults
29
28
  * (which would silently widen the query).
30
29
  */
31
- declare function parseCoordinateList(raw: unknown): number[] | null;
30
+ export declare function parseCoordinateList(raw: unknown): number[] | null;
32
31
  /**
33
32
  * Validate a [lng, lat] pair against MongoDB's accepted ranges.
34
33
  * Longitude: [-180, 180]. Latitude: [-90, 90]. Out-of-range coordinates
@@ -36,7 +35,7 @@ declare function parseCoordinateList(raw: unknown): number[] | null;
36
35
  * with `coordinates: [999, 40]` would either error inside Mongo or worse,
37
36
  * silently behave unexpectedly.
38
37
  */
39
- declare function isValidLngLat(lng: number, lat: number): boolean;
38
+ export declare function isValidLngLat(lng: number, lat: number): boolean;
40
39
  /**
41
40
  * Build a `$near` or `$nearSphere` filter for a single field from a coordinate
42
41
  * list. Accepts:
@@ -45,7 +44,7 @@ declare function isValidLngLat(lng: number, lat: number): boolean;
45
44
  *
46
45
  * Returns null on any validation failure (drop the filter).
47
46
  */
48
- declare function buildNearFilter(variant: 'near' | 'nearSphere', coords: number[]): Record<string, unknown> | null;
47
+ export declare function buildNearFilter(variant: 'near' | 'nearSphere', coords: number[]): Record<string, unknown> | null;
49
48
  /**
50
49
  * Build a `$geoWithin: $centerSphere` filter from [lng, lat, radiusMeters].
51
50
  *
@@ -62,14 +61,14 @@ declare function buildNearFilter(variant: 'near' | 'nearSphere', coords: number[
62
61
  * `$centerSphere` takes the radius in radians, so we convert from the
63
62
  * caller-friendly meters using Earth's equatorial radius.
64
63
  */
65
- declare function buildWithinRadiusFilter(coords: number[]): Record<string, unknown> | null;
64
+ export declare function buildWithinRadiusFilter(coords: number[]): Record<string, unknown> | null;
66
65
  /**
67
66
  * Build a `$geoWithin: $box` filter from a 4-element coordinate list:
68
67
  * [minLng, minLat, maxLng, maxLat]
69
68
  *
70
69
  * Returns null on any validation failure (drop the filter).
71
70
  */
72
- declare function buildGeoWithinBoxFilter(coords: number[]): Record<string, unknown> | null;
71
+ export declare function buildGeoWithinBoxFilter(coords: number[]): Record<string, unknown> | null;
73
72
  /**
74
73
  * Rewrite a filter object that contains `$near` / `$nearSphere` into an
75
74
  * equivalent count-compatible filter using `$geoWithin: $centerSphere`.
@@ -91,7 +90,7 @@ declare function buildGeoWithinBoxFilter(coords: number[]): Record<string, unkno
91
90
  * rewritten to a bounded `$centerSphere`; caller should fall back to
92
91
  * `countStrategy: 'none'`)
93
92
  */
94
- declare function rewriteNearForCount(filters: unknown): Record<string, unknown> | null;
93
+ export declare function rewriteNearForCount(filters: unknown): Record<string, unknown> | null;
95
94
  /**
96
95
  * Detect whether a Mongo filter object contains a `$near` or `$nearSphere`
97
96
  * operator on any field at the top level. These are SORT operators in
@@ -104,13 +103,11 @@ declare function rewriteNearForCount(filters: unknown): Record<string, unknown>
104
103
  *
105
104
  * Returns false for falsy / non-object inputs.
106
105
  */
107
- declare function hasNearOperator(filters: unknown): boolean;
106
+ export declare function hasNearOperator(filters: unknown): boolean;
108
107
  /**
109
108
  * High-level entry point: given an operator name and the raw value from the
110
109
  * URL, return the MongoDB filter for that field — or null if the operator is
111
110
  * not a geo operator (caller should fall through to normal handling) or the
112
111
  * value is invalid (caller should drop the filter).
113
112
  */
114
- declare function parseGeoFilter(operator: string, raw: unknown): Record<string, unknown> | null;
115
- //#endregion
116
- export { GEO_OPERATORS, GeoOperator, buildGeoWithinBoxFilter, buildNearFilter, buildWithinRadiusFilter, hasNearOperator, isGeoOperator, isValidLngLat, parseCoordinateList, parseGeoFilter, rewriteNearForCount };
113
+ export declare function parseGeoFilter(operator: string, raw: unknown): Record<string, unknown> | null;
@@ -1,4 +1,4 @@
1
- //#region src/query/primitives/geo.ts
1
+ // src/query/primitives/geo.ts
2
2
  /**
3
3
  * Geo query primitives
4
4
  *
@@ -207,5 +207,4 @@ function parseGeoFilter(operator, raw) {
207
207
  if (operator === "withinRadius") return buildWithinRadiusFilter(coords);
208
208
  return null;
209
209
  }
210
- //#endregion
211
210
  export { GEO_OPERATORS, buildGeoWithinBoxFilter, buildNearFilter, buildWithinRadiusFilter, hasNearOperator, isGeoOperator, isValidLngLat, parseCoordinateList, parseGeoFilter, rewriteNearForCount };
@@ -1,2 +1,2 @@
1
- import { n as SchemaIndexes, r as extractSchemaIndexes, t as IndexableSchema } from "../../indexes-DIjMpYES.mjs";
1
+ import { n as SchemaIndexes, r as extractSchemaIndexes, t as IndexableSchema } from "../../indexes-FfyOuhDK.mjs";
2
2
  export { IndexableSchema, SchemaIndexes, extractSchemaIndexes };
@@ -1,4 +1,4 @@
1
- //#region src/query/primitives/indexes.ts
1
+ // src/query/primitives/indexes.ts
2
2
  const EMPTY = {
3
3
  geoFields: [],
4
4
  textFields: [],
@@ -42,5 +42,4 @@ function extractSchemaIndexes(schema) {
42
42
  other
43
43
  };
44
44
  }
45
- //#endregion
46
45
  export { extractSchemaIndexes };
@@ -1,6 +1,6 @@
1
- import { t as createError } from "./error-BuByZwKU.mjs";
1
+ import { t as createError } from "./error-DjdmPLWO.mjs";
2
2
  import mongoose from "mongoose";
3
- //#region src/repository/query-defaults.ts
3
+ // src/repository/query-defaults.ts
4
4
  /**
5
5
  * Query defaults — the time bound and read/write concerns every repository command carries.
6
6
  *
@@ -204,5 +204,4 @@ function applyToAggregate(aggregation, o) {
204
204
  if (o.allowDiskUse !== void 0) aggregation.allowDiskUse(o.allowDiskUse);
205
205
  if (o.hint !== void 0) aggregation.hint(o.hint);
206
206
  }
207
- //#endregion
208
207
  export { assertQueryDefaultsConfigured as a, getQueryDefaults as c, setTransactionDeadline as d, applyToQuery as i, resetQueryDefaults as l, applyCursorTimeoutMode as n, configureAggregateDefaults as o, applyToAggregate as r, configureQueryDefaults as s, QUERY_DEFAULTS_ERROR_CODES as t, resolveQueryOptions as u };
@@ -1,18 +1,17 @@
1
- import { r as Repository } from "../Repository-DnL4xk5w.mjs";
1
+ import { r as Repository } from "../Repository-B6oL6OMv.mjs";
2
2
  import { BulkUpsertResult } from "@classytic/repo-core/repository";
3
- //#region src/read-model/index.d.ts
4
- declare const READ_MODEL_ERROR_CODES: {
5
- readonly MERGE_IN_TRANSACTION: "mongokit.read_model.merge_in_transaction";
6
- readonly ON_NOT_UNIQUE: "mongokit.read_model.on_not_unique";
7
- readonly ON_MISSING_SCOPE: "mongokit.read_model.on_missing_scope";
8
- readonly DEDUPE_NEEDS_TRANSACTION: "mongokit.read_model.dedupe_needs_transaction";
9
- readonly DEDUPE_KEY_MISSING: "mongokit.read_model.dedupe_key_missing";
10
- readonly INCREMENT_FAILED: "mongokit.read_model.increment_failed";
11
- readonly TOO_LARGE: "mongokit.read_model.too_large";
3
+ export declare const READ_MODEL_ERROR_CODES: {
4
+ readonly MERGE_IN_TRANSACTION: 'mongokit.read_model.merge_in_transaction';
5
+ readonly ON_NOT_UNIQUE: 'mongokit.read_model.on_not_unique';
6
+ readonly ON_MISSING_SCOPE: 'mongokit.read_model.on_missing_scope';
7
+ readonly DEDUPE_NEEDS_TRANSACTION: 'mongokit.read_model.dedupe_needs_transaction';
8
+ readonly DEDUPE_KEY_MISSING: 'mongokit.read_model.dedupe_key_missing';
9
+ readonly INCREMENT_FAILED: 'mongokit.read_model.increment_failed';
10
+ readonly TOO_LARGE: 'mongokit.read_model.too_large';
12
11
  };
13
12
  /** Caller scope forwarded to every repository call (tenant, bypass, attribution). */
14
- type ReadModelScope = Record<string, unknown>;
15
- interface IncrementGrain {
13
+ export type ReadModelScope = Record<string, unknown>;
14
+ export interface IncrementGrain {
16
15
  /** The read-model key (without the policy scope, which the repository adds). */
17
16
  key: Record<string, unknown>;
18
17
  inc: Record<string, number>;
@@ -21,12 +20,12 @@ interface IncrementGrain {
21
20
  dedupeKey?: string;
22
21
  }
23
22
  /** Sum grains per key, apply them in one upsert; with a ledger, count each dedupeKey once. */
24
- declare function applyIncrements<TDoc>(target: Repository<TDoc>, grains: readonly IncrementGrain[], options?: ReadModelScope & {
23
+ export declare function applyIncrements<TDoc>(target: Repository<TDoc>, grains: readonly IncrementGrain[], options?: ReadModelScope & {
25
24
  session?: unknown;
26
25
  /** Repository over a collection unique on (scope, `dedupeKey`). */
27
26
  ledger?: Repository<unknown>;
28
27
  }): Promise<BulkUpsertResult>;
29
- interface RebuildOptions {
28
+ export interface RebuildOptions {
30
29
  /** Source stages producing one row per read-model grain (with every `on` field except scope fields). */
31
30
  pipeline: readonly unknown[];
32
31
  /** Fields identifying a grain; must equal a unique index of the target and include its tenant field. */
@@ -37,11 +36,11 @@ interface RebuildOptions {
37
36
  session?: unknown;
38
37
  }
39
38
  /** Rebuild the scope's slice of `target` from `source` with one `$merge`, then drop stale grains. */
40
- declare function rebuildInto<TSrc, TDoc>(source: Repository<TSrc>, target: Repository<TDoc>, options: RebuildOptions): Promise<{
39
+ export declare function rebuildInto<TSrc, TDoc>(source: Repository<TSrc>, target: Repository<TDoc>, options: RebuildOptions): Promise<{
41
40
  rebuildId: string;
42
41
  removed: number;
43
42
  }>;
44
- interface ReconcileOptions {
43
+ export interface ReconcileOptions {
45
44
  pipeline: readonly unknown[];
46
45
  on: readonly string[];
47
46
  /** Fields compared between the recomputed and the stored row. */
@@ -50,7 +49,7 @@ interface ReconcileOptions {
50
49
  /** Refuse past this many rows on either side (both are held in memory). Default 100,000. */
51
50
  maxRows?: number;
52
51
  }
53
- interface DriftRow {
52
+ export interface DriftRow {
54
53
  key: Record<string, unknown>;
55
54
  /** Recomputed measures, `null` when the source produces no such grain. */
56
55
  expected: Record<string, unknown> | null;
@@ -58,9 +57,7 @@ interface DriftRow {
58
57
  actual: Record<string, unknown> | null;
59
58
  }
60
59
  /** Recompute the scope's grains from `source` and report every one that differs in `target`. */
61
- declare function reconcile<TSrc, TDoc>(source: Repository<TSrc>, target: Repository<TDoc>, options: ReconcileOptions): Promise<{
60
+ export declare function reconcile<TSrc, TDoc>(source: Repository<TSrc>, target: Repository<TDoc>, options: ReconcileOptions): Promise<{
62
61
  drift: DriftRow[];
63
62
  compared: number;
64
- }>;
65
- //#endregion
66
- export { DriftRow, IncrementGrain, READ_MODEL_ERROR_CODES, ReadModelScope, RebuildOptions, ReconcileOptions, applyIncrements, rebuildInto, reconcile };
63
+ }>;
@@ -1,7 +1,7 @@
1
- import { t as createError } from "../error-BuByZwKU.mjs";
2
- import { i as scopeForCollection, o as tenantFieldsOf } from "../join-scope-DSAznE8E.mjs";
1
+ import { i as scopeForCollection, o as tenantFieldsOf } from "../join-scope-C1gOtZ59.mjs";
2
+ import { t as createError } from "../error-DjdmPLWO.mjs";
3
3
  import { randomUUID } from "node:crypto";
4
- //#region src/read-model/index.ts
4
+ // src/read-model/index.ts
5
5
  /**
6
6
  * `@classytic/mongokit/read-model` — maintain and verify a derived (read) collection.
7
7
  *
@@ -189,5 +189,4 @@ async function reconcile(source, target, options) {
189
189
  compared: expectedRows.length
190
190
  };
191
191
  }
192
- //#endregion
193
192
  export { READ_MODEL_ERROR_CODES, applyIncrements, rebuildInto, reconcile };