@classytic/mongokit 3.43.1 → 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.
- package/README.md +14 -0
- package/dist/{PaginationEngine-DZnkbSrr.mjs → PaginationEngine-C9iS0U5l.mjs} +13 -27
- package/dist/{PaginationEngine-CRHyuUtw.d.mts → PaginationEngine-D17AthKw.d.mts} +1 -3
- package/dist/{Repository-DnL4xk5w.d.mts → Repository-B6oL6OMv.d.mts} +33 -11
- package/dist/{Repository-Dj6xqPxJ.mjs → Repository-eMRYZ_2Y.mjs} +204 -92
- package/dist/actions/index.d.mts +1 -1
- package/dist/actions/index.mjs +2 -2
- package/dist/{actions-ChYfkPYP.mjs → actions-DExyXMTy.mjs} +3 -4
- package/dist/adapter/index.d.mts +6 -10
- package/dist/adapter/index.mjs +1 -1
- package/dist/{adapter-CkMoMF83.mjs → adapter-Qzgc3ZD_.mjs} +4 -6
- package/dist/ai/index.d.mts +21 -8
- package/dist/ai/index.mjs +15 -9
- package/dist/better-auth/index.d.mts +17 -19
- package/dist/better-auth/index.mjs +3 -4
- package/dist/{coercion-BjdPX3YF.d.mts → coercion-COp9DRNw.d.mts} +0 -2
- package/dist/{create-repository-CJtVdwig.d.mts → create-repository-BOFUYj1l.d.mts} +5 -7
- package/dist/{create-repository-UjwPWR1z.mjs → create-repository-D7MQpIZo.mjs} +4 -5
- package/dist/{derive-DRBiegRH.mjs → derive-Dxsc31fV.mjs} +3 -6
- package/dist/{error-BuByZwKU.mjs → error-DjdmPLWO.mjs} +1 -2
- package/dist/{field-selection-FSQFLpsU.mjs → field-selection-DPFaFw9Y.mjs} +1 -2
- package/dist/{id-chunks-BmAwsqNk.mjs → id-chunks-DH-RAZWG.mjs} +13 -8
- package/dist/{id-resolution-BqDrk0S2.mjs → id-resolution-Cqh49d9J.mjs} +1 -2
- package/dist/idempotency/index.d.mts +4 -7
- package/dist/idempotency/index.mjs +1 -2
- package/dist/{index-SYF8N28D.d.mts → index-8QUEsOFI.d.mts} +3 -4
- package/dist/{index-C0AjVqX3.d.mts → index-ehGZLbrd.d.mts} +2 -8
- package/dist/index.d.mts +63 -96
- package/dist/index.mjs +36 -52
- package/dist/indexes/verify-indexes.d.mts +8 -11
- package/dist/indexes/verify-indexes.mjs +1 -2
- package/dist/{indexes-DIjMpYES.d.mts → indexes-FfyOuhDK.d.mts} +0 -2
- package/dist/{join-scope-DSAznE8E.mjs → join-scope-C1gOtZ59.mjs} +2 -3
- package/dist/kernel-conformance/index.d.mts +39 -13
- package/dist/kernel-conformance/index.mjs +4 -7
- package/dist/lock/index.d.mts +134 -7
- package/dist/lock/index.mjs +349 -14
- package/dist/{logger-K7dPmu2U.mjs → logger-hbWOlj_X.mjs} +1 -2
- package/dist/{method-registry.plugin-C63pGn1d.mjs → method-registry.plugin-CGAepsBU.mjs} +3 -5
- package/dist/{model-registry-ClKtWiHa.mjs → model-registry-DrVfJ3Nt.mjs} +1 -2
- package/dist/{mongooseToJsonSchema-C3k4ide0.mjs → mongooseToJsonSchema-DMDotz4_.mjs} +2 -3
- package/dist/{multi-tenant.plugin-B_q9NUHc.d.mts → multi-tenant.plugin-DfeDMiI8.d.mts} +143 -11
- package/dist/{operations-XiFgG5US.d.mts → operations-Dw9OFV0V.d.mts} +14 -5
- package/dist/outbox/index.d.mts +24 -9
- package/dist/outbox/index.mjs +17 -6
- package/dist/pagination/PaginationEngine.d.mts +1 -1
- package/dist/pagination/PaginationEngine.mjs +1 -1
- package/dist/pagination/utils/limits.d.mts +6 -9
- package/dist/pagination/utils/limits.mjs +2 -3
- package/dist/{pagination-D6psses0.d.mts → pagination-DAUg5zOY.d.mts} +2 -10
- package/dist/{plugin-options-Cirmb4Kp.d.mts → plugin-options-Bpcuz9kS.d.mts} +2 -4
- package/dist/plugins/index.d.mts +6 -7
- package/dist/plugins/index.mjs +6 -7
- package/dist/query/primitives/coercion.d.mts +1 -1
- package/dist/query/primitives/coercion.mjs +2 -3
- package/dist/query/primitives/geo.d.mts +11 -14
- package/dist/query/primitives/geo.mjs +1 -2
- package/dist/query/primitives/indexes.d.mts +1 -1
- package/dist/query/primitives/indexes.mjs +1 -2
- package/dist/{query-defaults-BxUcSOoF.mjs → query-defaults-aUoKlEbh.mjs} +2 -3
- package/dist/read-model/index.d.mts +18 -21
- package/dist/read-model/index.mjs +3 -4
- package/dist/{repository-MqAP409e.d.mts → repository-DzVIwhU2.d.mts} +25 -29
- package/dist/retention-purge-DqcYvRnG.d.mts +35 -0
- package/dist/{rolldown-runtime-D7D4PA-g.mjs → rolldown-runtime-D8jQpDG7.mjs} +1 -2
- package/dist/search/index.d.mts +1 -1
- package/dist/search/index.mjs +1 -1
- package/dist/sync/index.d.mts +95 -15
- package/dist/sync/index.mjs +308 -62
- package/dist/tenant/index.d.mts +8 -11
- package/dist/tenant/index.mjs +1 -2
- package/dist/testkit/index.d.mts +179 -23
- package/dist/testkit/index.mjs +421 -23
- package/dist/{timestamp.plugin-DpOWavVI.mjs → timestamp.plugin-Bz_zL9PX.mjs} +192 -49
- package/dist/{to-plain-vksRrLtc.mjs → to-plain-CEKv_ylg.mjs} +2 -4
- package/dist/{to-plain-o5tUY2nV.d.mts → to-plain-PO5r1Qoy.d.mts} +2 -16
- package/dist/{transaction-DmiB4k2P.mjs → transaction-C2PFxfIv.mjs} +5 -8
- package/dist/{type-utils-CLzRFtIA.d.mts → type-utils-CKvuewAL.d.mts} +0 -2
- package/dist/{update-WgeAUJ_I.mjs → update-DcfmNbJe.mjs} +12 -20
- package/dist/usage/index.d.mts +2 -5
- package/dist/usage/index.mjs +8 -6
- package/dist/utils/index.d.mts +8 -10
- package/dist/utils/index.mjs +7 -7
- package/dist/{validation-chain.plugin-BAeC5eVT.d.mts → validation-chain.plugin-B3gZCZj4.d.mts} +135 -48
- package/dist/{validation-chain.plugin-DRApTmkN.mjs → validation-chain.plugin-DNY6MIF6.mjs} +207 -55
- package/llms.txt +33 -0
- package/package.json +29 -25
- package/skills/mongokit/SKILL.md +112 -0
- package/skills/mongokit/references/pagination-search.md +87 -0
- package/skills/mongokit/references/plugins-tenancy.md +102 -0
- package/skills/mongokit/references/repository-api.md +83 -0
- package/skills/mongokit/references/transactions-outbox.md +101 -0
package/README.md
CHANGED
|
@@ -201,6 +201,8 @@ await orderRepo.withTransaction(async (txRepo) => {
|
|
|
201
201
|
});
|
|
202
202
|
```
|
|
203
203
|
|
|
204
|
+
To serialise writers on a row, the write must change it. An update that sets a field to the value it already has is a no-op: it takes no write lock, so two transactions doing it at the same instant never conflict. Write something that changes (for example `$inc: { writes: 1 }` on a gate or lease row).
|
|
205
|
+
|
|
204
206
|
### Time Bounds And Concerns (`queryDefaults`)
|
|
205
207
|
|
|
206
208
|
```ts
|
|
@@ -529,6 +531,18 @@ await assertQueryPlan(() => repo.getAll({ filters: { status: 'open' }, sort: { a
|
|
|
529
531
|
});
|
|
530
532
|
```
|
|
531
533
|
|
|
534
|
+
Reads are gated by default; pass `commands: ['findAndModify', 'update', 'delete']` to gate a write's match too.
|
|
535
|
+
`explainCommands(run, { connection, commands?, collections?, verbosity? })` returns the raw explain of every
|
|
536
|
+
command `run` sent (writes are explained, never re-run), for a plugin-built query such as a `leasePlugin` claim:
|
|
537
|
+
|
|
538
|
+
```ts
|
|
539
|
+
import { explainCommands } from '@classytic/mongokit/testkit';
|
|
540
|
+
const { explains } = await explainCommands(() => jobs.lease({ leaseFor: 30_000, leasedBy }), {
|
|
541
|
+
connection, commands: ['findAndModify'], collections: ['jobs'],
|
|
542
|
+
});
|
|
543
|
+
explains[0].explain.executionStats; // what the claim examined
|
|
544
|
+
```
|
|
545
|
+
|
|
532
546
|
## Kernel Conformance — `@classytic/mongokit/kernel-conformance`
|
|
533
547
|
|
|
534
548
|
An **executable contract suite** for domain kernels built on `defineModels()`. A kernel that
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import {
|
|
3
|
-
import { t as createError } from "./error-
|
|
4
|
-
import {
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D8jQpDG7.mjs";
|
|
2
|
+
import { i as applyToQuery, r as applyToAggregate, u as resolveQueryOptions } from "./query-defaults-aUoKlEbh.mjs";
|
|
3
|
+
import { t as createError } from "./error-DjdmPLWO.mjs";
|
|
4
|
+
import { n as warn } from "./logger-hbWOlj_X.mjs";
|
|
5
5
|
import { calculateSkip, calculateTotalPages, shouldWarnDeepPagination, validateLimit, validatePage } from "./pagination/utils/limits.mjs";
|
|
6
6
|
import mongoose from "mongoose";
|
|
7
7
|
import { createTtlMemo } from "@classytic/repo-core/cache";
|
|
8
8
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
9
9
|
import { CURSOR_ERROR_CODES } from "@classytic/repo-core/pagination";
|
|
10
|
-
|
|
10
|
+
// src/pagination/utils/cursor-signing.ts
|
|
11
11
|
/**
|
|
12
12
|
* HMAC signing for pagination cursors.
|
|
13
13
|
*
|
|
@@ -122,8 +122,7 @@ function verifySignature(token, secrets) {
|
|
|
122
122
|
for (const key of secrets) if (matches(signature, sign(payload, key))) return payload;
|
|
123
123
|
throw new Error("Invalid cursor token: signature does not verify (tampered, or issued under a retired key)");
|
|
124
124
|
}
|
|
125
|
-
|
|
126
|
-
//#region src/pagination/defaults.ts
|
|
125
|
+
// src/pagination/defaults.ts
|
|
127
126
|
/**
|
|
128
127
|
* The policy lives on `globalThis` under a registered symbol, NOT in a module
|
|
129
128
|
* `let`.
|
|
@@ -215,8 +214,7 @@ function define(target, key, explicit, fallback) {
|
|
|
215
214
|
get: () => explicit !== void 0 ? explicit : policy()[key] ?? fallback
|
|
216
215
|
});
|
|
217
216
|
}
|
|
218
|
-
|
|
219
|
-
//#region src/pagination/utils/filter.ts
|
|
217
|
+
// src/pagination/utils/filter.ts
|
|
220
218
|
/**
|
|
221
219
|
* Combine the caller's filters with the keyset position predicate.
|
|
222
220
|
*
|
|
@@ -327,8 +325,7 @@ function buildKeysetFilter(baseFilters, sort, cursorValue, cursorId, cursorValue
|
|
|
327
325
|
if (orConditions.length === 0) return combine(baseFilters, { _id: { $in: [] } });
|
|
328
326
|
return combine(baseFilters, { $or: orConditions });
|
|
329
327
|
}
|
|
330
|
-
|
|
331
|
-
//#region src/pagination/utils/guards.ts
|
|
328
|
+
// src/pagination/utils/guards.ts
|
|
332
329
|
/**
|
|
333
330
|
* Pagination guards shared by every paged read: the deep-offset refusal, the unique `_id`
|
|
334
331
|
* tiebreaker that makes a sort a total order, and the cursor SCOPE fingerprint — a hash of
|
|
@@ -446,8 +443,7 @@ function warnIfSortNotTotal(model, pipeline, warnFn) {
|
|
|
446
443
|
warnedSortSites.add(site);
|
|
447
444
|
warnFn(`[mongokit] aggregatePipelinePaginate on '${model}': the page sort is not provably total, so rows that tie can repeat or be skipped across pages. End the \$sort on a key unique per output row, then pass \`sortIsTotal: true\` (or sort on _id with no \$unwind/\$group/_id rewrite before the sort).`);
|
|
448
445
|
}
|
|
449
|
-
|
|
450
|
-
//#region src/pagination/utils/cursor.ts
|
|
446
|
+
// src/pagination/utils/cursor.ts
|
|
451
447
|
/**
|
|
452
448
|
* Cursor Utilities
|
|
453
449
|
*
|
|
@@ -455,12 +451,8 @@ function warnIfSortNotTotal(model, pipeline, warnFn) {
|
|
|
455
451
|
* Cursors are base64-encoded JSON containing position data and metadata.
|
|
456
452
|
*/
|
|
457
453
|
var cursor_exports = /* @__PURE__ */ __exportAll({
|
|
458
|
-
decodeCursor: () => decodeCursor,
|
|
459
454
|
encodeCursor: () => encodeCursor,
|
|
460
|
-
|
|
461
|
-
resolveCursorFilter: () => resolveCursorFilter,
|
|
462
|
-
validateCursorSort: () => validateCursorSort,
|
|
463
|
-
validateCursorVersion: () => validateCursorVersion
|
|
455
|
+
resolveCursorFilter: () => resolveCursorFilter
|
|
464
456
|
});
|
|
465
457
|
/**
|
|
466
458
|
* Encodes document values and sort metadata into a base64 cursor token
|
|
@@ -655,8 +647,7 @@ function resolveCursorFilter(after, sort, cursorVersion, baseFilters, minCursorV
|
|
|
655
647
|
validateCursorSort(cursor.sort, sort);
|
|
656
648
|
return buildKeysetFilter(baseFilters, buildSort, cursor.value, cursor.id, cursor.values);
|
|
657
649
|
}
|
|
658
|
-
|
|
659
|
-
//#region src/pagination/utils/index-hint.ts
|
|
650
|
+
// src/pagination/utils/index-hint.ts
|
|
660
651
|
/**
|
|
661
652
|
* The only operators that give the query planner a *bounded equality* it can
|
|
662
653
|
* lead an index with. Everything else (`$ne`, `$nin`, `$gt(e)`, `$lt(e)`,
|
|
@@ -789,12 +780,9 @@ function hasCompatibleKeysetIndex(indexes, filterFields, sort) {
|
|
|
789
780
|
}
|
|
790
781
|
return false;
|
|
791
782
|
}
|
|
792
|
-
|
|
793
|
-
//#region src/pagination/utils/sort.ts
|
|
783
|
+
// src/pagination/utils/sort.ts
|
|
794
784
|
var sort_exports = /* @__PURE__ */ __exportAll({
|
|
795
785
|
getPrimaryField: () => getPrimaryField,
|
|
796
|
-
invertSort: () => invertSort,
|
|
797
|
-
normalizeSort: () => normalizeSort,
|
|
798
786
|
validateKeysetSort: () => validateKeysetSort
|
|
799
787
|
});
|
|
800
788
|
/**
|
|
@@ -882,8 +870,7 @@ function invertSort(sort) {
|
|
|
882
870
|
function getPrimaryField(sort) {
|
|
883
871
|
return Object.keys(sort).find((k) => k !== "_id") || "_id";
|
|
884
872
|
}
|
|
885
|
-
|
|
886
|
-
//#region src/pagination/PaginationEngine.ts
|
|
873
|
+
// src/pagination/PaginationEngine.ts
|
|
887
874
|
/**
|
|
888
875
|
* Pagination Engine
|
|
889
876
|
*
|
|
@@ -1353,5 +1340,4 @@ var PaginationEngine = class {
|
|
|
1353
1340
|
};
|
|
1354
1341
|
}
|
|
1355
1342
|
};
|
|
1356
|
-
//#endregion
|
|
1357
1343
|
export { resolveCursorSecrets as _, cursor_exports as a, PAGINATION_ERROR_CODES as c, withGroupTiebreak as d, withIdTiebreak as f, attachSignature as g, resetPaginationDefaults as h, validateKeysetSort as i, assertOffsetWithinCap as l, getPaginationDefaults as m, getPrimaryField as n, encodeCursor as o, configurePaginationDefaults as p, sort_exports as r, resolveCursorFilter as s, PaginationEngine as t, cursorScope as u, verifySignature as v };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { D as AnyDocument, c as MongokitPageExtras, f as CursorSecret, i as CountStrategy, l as OffsetPaginationOptions, s as KeysetPaginationOptions, t as AggregatePaginationOptions, u as PaginationConfig } from "./pagination-
|
|
1
|
+
import { D as AnyDocument, c as MongokitPageExtras, f as CursorSecret, i as CountStrategy, l as OffsetPaginationOptions, s as KeysetPaginationOptions, t as AggregatePaginationOptions, u as PaginationConfig } from "./pagination-DAUg5zOY.mjs";
|
|
2
2
|
import { Model } from "mongoose";
|
|
3
3
|
import { TtlMemo } from "@classytic/repo-core/cache";
|
|
4
4
|
import { AggregatePaginationResult, KeysetPaginationResult, OffsetPaginationResult } from "@classytic/repo-core/pagination";
|
|
5
|
-
//#region src/pagination/PaginationEngine.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Internal pagination config with required values
|
|
8
7
|
*/
|
|
@@ -138,5 +137,4 @@ declare class PaginationEngine<TDoc = AnyDocument> {
|
|
|
138
137
|
*/
|
|
139
138
|
aggregatePaginate(options?: AggregatePaginationOptions): Promise<AggregatePaginationResult<TDoc, MongokitPageExtras>>;
|
|
140
139
|
}
|
|
141
|
-
//#endregion
|
|
142
140
|
export { PaginationEngine as n, CountMemoKey as t };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
1
|
+
import { A as ObjectId, F as SortSpec$1, M as ReadPreferenceType, N as SelectSpec, c as MongokitPageExtras, i as CountStrategy, j as PopulateSpec, r as CollationOptions, t as AggregatePaginationOptions, u as PaginationConfig } from "./pagination-DAUg5zOY.mjs";
|
|
2
|
+
import { r as RetentionPurgeRequest } from "./retention-purge-DqcYvRnG.mjs";
|
|
3
|
+
import { n as PaginationEngine } from "./PaginationEngine-D17AthKw.mjs";
|
|
4
|
+
import { S as LookupOptions, _ as SessionOptions, b as WithTransactionOptions, c as DeleteResult, f as LookupPopulateOptions, g as ReadOptions, h as OperationOptions, i as CacheableOptions, l as FindOneAndUpdateOptions, n as AggregateOptions, o as CreateOptions, p as LookupPopulateResult, s as DeleteManyResult, t as AggregateCallOptions, u as GetByIdsOptions, v as UpdateManyResult, x as LookupBuilder, y as UpdateOptions } from "./operations-Dw9OFV0V.mjs";
|
|
5
|
+
import { _ as RepositoryOptions, d as PluginType, f as PrioritizedHook, o as Middleware, p as RepositoryContext } from "./repository-DzVIwhU2.mjs";
|
|
5
6
|
import { AggPaginationRequest, AggRequest, AggResult, ArchiveOptions, ArchiveResult, ArchiveSink, BulkUpsertOptions, BulkUpsertResult, ChangeEvent, FilterInput, KeysetAggPaginationResult, QueryOptions, RepoCapabilities, RepositoryBase, TenantPurgeOptions, TenantPurgeResult, TenantPurgeStrategy, WatchOptions } from "@classytic/repo-core/repository";
|
|
6
7
|
import { ClientSession, Expression, Model, PipelineStage, PopulateOptions } from "mongoose";
|
|
7
8
|
import { Filter } from "@classytic/repo-core/filter";
|
|
@@ -9,7 +10,13 @@ import { RepositoryCacheHandle } from "@classytic/repo-core/cache";
|
|
|
9
10
|
import { HttpError } from "@classytic/repo-core/errors";
|
|
10
11
|
import { UpdateInput } from "@classytic/repo-core/update";
|
|
11
12
|
import { AggregatePaginationResult, KeysetPaginationResult, OffsetPaginationResult, OffsetPaginationResultCore } from "@classytic/repo-core/pagination";
|
|
12
|
-
|
|
13
|
+
/**
|
|
14
|
+
* `purgeByFilter` / `purgeByField` options: repo-core's `TenantPurgeOptions`
|
|
15
|
+
* plus the audited `retentionPurge` (see `SessionOptions.retentionPurge`).
|
|
16
|
+
*/
|
|
17
|
+
type RetentionTenantPurgeOptions = TenantPurgeOptions & {
|
|
18
|
+
retentionPurge?: RetentionPurgeRequest | undefined;
|
|
19
|
+
};
|
|
13
20
|
/** Options for $vectorSearch stage (Atlas only) */
|
|
14
21
|
interface VectorSearchOptions {
|
|
15
22
|
/** Atlas Search index name */
|
|
@@ -475,8 +482,6 @@ declare class AggregationBuilder {
|
|
|
475
482
|
* .exec(Model)
|
|
476
483
|
* ```
|
|
477
484
|
*/
|
|
478
|
-
//#endregion
|
|
479
|
-
//#region src/Repository.d.ts
|
|
480
485
|
/**
|
|
481
486
|
* Plugin phase priorities (lower = runs first).
|
|
482
487
|
*
|
|
@@ -1397,8 +1402,26 @@ declare class Repository<TDoc = unknown> extends RepositoryBase {
|
|
|
1397
1402
|
history?: string | false;
|
|
1398
1403
|
/** Timestamp for the history entry — default `new Date()`. */
|
|
1399
1404
|
at?: Date;
|
|
1405
|
+
/**
|
|
1406
|
+
* When the row entered its current state (the caller's read).
|
|
1407
|
+
* Adds `durationInPriorMs: max(0, occurredAt - priorAt)` to the
|
|
1408
|
+
* history entry, the same field primitives' `appendStatus` writes,
|
|
1409
|
+
* without a pre-read here. Pair it with a `where` (e.g.
|
|
1410
|
+
* `{ updatedAt: current.updatedAt }`) or `options.target` so a write
|
|
1411
|
+
* between the read and the claim makes the claim miss rather than
|
|
1412
|
+
* record a stale duration. Requires history (400 with `history: false`).
|
|
1413
|
+
*/
|
|
1414
|
+
priorAt?: Date;
|
|
1415
|
+
/**
|
|
1416
|
+
* Extra fields merged into the history entry. May not contain the
|
|
1417
|
+
* reserved keys `status`, `occurredAt`, `by`, `note` or
|
|
1418
|
+
* `durationInPriorMs` (400). Requires history.
|
|
1419
|
+
*/
|
|
1420
|
+
historyExtra?: Record<string, unknown>;
|
|
1400
1421
|
}, options?: SessionOptions & {
|
|
1401
1422
|
idField?: string;
|
|
1423
|
+
/** Forwarded to `claim()`: the caller's same-session read, pinned by version / `updatedAt`. */
|
|
1424
|
+
target?: Record<string, unknown>;
|
|
1402
1425
|
}): Promise<TDoc>;
|
|
1403
1426
|
/**
|
|
1404
1427
|
* Optimistic-concurrency CAS via a version stamp.
|
|
@@ -1566,7 +1589,7 @@ declare class Repository<TDoc = unknown> extends RepositoryBase {
|
|
|
1566
1589
|
* + strategy writes). See [actions/purge.ts](./actions/purge.ts) for
|
|
1567
1590
|
* the port implementation.
|
|
1568
1591
|
*/
|
|
1569
|
-
purgeByField(field: string, value: unknown, strategy: TenantPurgeStrategy, options?:
|
|
1592
|
+
purgeByField(field: string, value: unknown, strategy: TenantPurgeStrategy, options?: RetentionTenantPurgeOptions): Promise<TenantPurgeResult>;
|
|
1570
1593
|
/**
|
|
1571
1594
|
* Range/filter-scoped purge — see `StandardRepo.purgeByFilter` for the
|
|
1572
1595
|
* cross-kit contract. The compliance primitive for "purge/anonymize a
|
|
@@ -1581,7 +1604,7 @@ declare class Repository<TDoc = unknown> extends RepositoryBase {
|
|
|
1581
1604
|
* the same dual-dialect rule as `archiveByFilter` and every other verb.
|
|
1582
1605
|
* See [actions/purge.ts](./actions/purge.ts) for the port.
|
|
1583
1606
|
*/
|
|
1584
|
-
purgeByFilter(filter: Record<string, unknown> | Filter, strategy: TenantPurgeStrategy, options?:
|
|
1607
|
+
purgeByFilter(filter: Record<string, unknown> | Filter, strategy: TenantPurgeStrategy, options?: RetentionTenantPurgeOptions): Promise<TenantPurgeResult>;
|
|
1585
1608
|
/**
|
|
1586
1609
|
* Chunked cold-storage extraction — see `StandardRepo.archiveByFilter`
|
|
1587
1610
|
* for the cross-kit contract (write-before-delete, at-least-once,
|
|
@@ -1989,5 +2012,4 @@ declare class Repository<TDoc = unknown> extends RepositoryBase {
|
|
|
1989
2012
|
_handleError(error: Error): HttpError;
|
|
1990
2013
|
private _translateError;
|
|
1991
2014
|
}
|
|
1992
|
-
|
|
1993
|
-
export { AggregationBuilder as a, ProjectionSpec as c, VectorSearchOptions as d, TransitionMachine as i, SortOrder as l, HOOK_PRIORITY as n, AggregationPlan as o, Repository as r, GroupSpec as s, GetAllParams as t, SortSpec as u };
|
|
2015
|
+
export { AggregationBuilder as a, ProjectionSpec as c, VectorSearchOptions as d, RetentionTenantPurgeOptions as f, TransitionMachine as i, SortOrder as l, HOOK_PRIORITY as n, AggregationPlan as o, Repository as r, GroupSpec as s, GetAllParams as t, SortSpec as u };
|