@classytic/mongokit 3.40.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.
- package/README.md +71 -0
- package/dist/{PaginationEngine-D-P19Y9m.d.mts → PaginationEngine-CRHyuUtw.d.mts} +17 -3
- package/dist/{PaginationEngine-Dvl8jcRY.mjs → PaginationEngine-CfT2Cxkj.mjs} +296 -137
- package/dist/{Repository-BMgPSkqZ.mjs → Repository-CYhSC9ut.mjs} +571 -175
- package/dist/{Repository-CR8Y9g2E.d.mts → Repository-pnLw1rG5.d.mts} +57 -16
- package/dist/actions/index.d.mts +1 -1
- package/dist/actions/index.mjs +1 -1
- package/dist/adapter/index.mjs +1 -1
- package/dist/{adapter-BrVfPFSW.mjs → adapter-CkMoMF83.mjs} +1 -1
- package/dist/ai/index.d.mts +1 -1
- package/dist/better-auth/index.mjs +2 -2
- package/dist/{create-repository-CAle1MSU.d.mts → create-repository-BUx9vfG9.d.mts} +5 -5
- package/dist/{create-repository-BzBUMvd1.mjs → create-repository-BYyWzLbt.mjs} +2 -2
- package/dist/{index-CmjNyulu.d.mts → index-SYF8N28D.d.mts} +37 -19
- package/dist/index.d.mts +55 -15
- package/dist/index.mjs +57 -11
- package/dist/join-scope-DSAznE8E.mjs +168 -0
- package/dist/{mongooseToJsonSchema-waUVQwK4.mjs → mongooseToJsonSchema-C3k4ide0.mjs} +5 -1
- package/dist/{multi-tenant.plugin-CBgCo9im.d.mts → multi-tenant.plugin-a3UhQARj.d.mts} +2 -2
- package/dist/{operations-CrRIoc8Z.d.mts → operations-XiFgG5US.d.mts} +36 -13
- package/dist/outbox/index.d.mts +1 -1
- package/dist/outbox/index.mjs +1 -1
- package/dist/pagination/PaginationEngine.d.mts +2 -2
- package/dist/pagination/PaginationEngine.mjs +1 -1
- package/dist/pagination/utils/limits.d.mts +1 -1
- package/dist/{pagination-BpIv2bdS.d.mts → pagination-D6psses0.d.mts} +116 -13
- package/dist/{plugin-options-Zk46lD6F.d.mts → plugin-options-CRhIvSzx.d.mts} +2 -2
- package/dist/plugins/index.d.mts +3 -3
- package/dist/plugins/index.mjs +2 -2
- package/dist/query-defaults-BxUcSOoF.mjs +208 -0
- package/dist/read-model/index.d.mts +66 -0
- package/dist/read-model/index.mjs +193 -0
- package/dist/{repository-odl03582.d.mts → repository-DNHfjAZX.d.mts} +16 -2
- package/dist/sync/index.d.mts +15 -2
- package/dist/sync/index.mjs +38 -1
- package/dist/testkit/index.d.mts +40 -3
- package/dist/testkit/index.mjs +113 -2
- package/dist/{timestamp.plugin-DF0gJB6p.mjs → timestamp.plugin-zfdLYZiO.mjs} +50 -31
- package/dist/{to-plain-k7SjNlSS.d.mts → to-plain-CjgEInWV.d.mts} +2 -2
- package/dist/{transaction-B5L9glO0.mjs → transaction-BrRYtH_b.mjs} +127 -5
- package/dist/{update-DG0fCwRJ.mjs → update-WgeAUJ_I.mjs} +44 -22
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.mjs +1 -1
- package/dist/{validation-chain.plugin-BLY2gLEk.mjs → validation-chain.plugin-CHUHWMtk.mjs} +15 -3
- package/dist/{validation-chain.plugin-DYp9E7K2.d.mts → validation-chain.plugin-CTcNJCmV.d.mts} +4 -4
- package/package.json +8 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
2
|
import { n as warn } from "./logger-K7dPmu2U.mjs";
|
|
3
3
|
import { t as createError } from "./error-BuByZwKU.mjs";
|
|
4
|
+
import { i as applyToQuery } from "./query-defaults-BxUcSOoF.mjs";
|
|
4
5
|
import { coerceFilterDates, isFilter } from "@classytic/repo-core/filter";
|
|
5
6
|
//#region src/actions/create.ts
|
|
6
7
|
var create_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -15,7 +16,16 @@ var create_exports = /* @__PURE__ */ __exportAll({
|
|
|
15
16
|
*/
|
|
16
17
|
async function create(Model, data, options = {}) {
|
|
17
18
|
const document = new Model(data);
|
|
18
|
-
|
|
19
|
+
const saveOptions = { session: options.session };
|
|
20
|
+
const bound = options.queryOptions?.maxTimeMS;
|
|
21
|
+
if (bound !== void 0) Object.assign(saveOptions, { timeoutMS: bound });
|
|
22
|
+
const wc = options.queryOptions?.writeConcern;
|
|
23
|
+
if (wc) Object.assign(saveOptions, { writeConcern: {
|
|
24
|
+
...wc.w !== void 0 ? { w: wc.w } : {},
|
|
25
|
+
...wc.j !== void 0 ? { j: wc.j } : {},
|
|
26
|
+
...wc.wtimeoutMS !== void 0 ? { wtimeout: wc.wtimeoutMS } : {}
|
|
27
|
+
} });
|
|
28
|
+
await document.save(saveOptions);
|
|
19
29
|
return document;
|
|
20
30
|
}
|
|
21
31
|
/** Narrow a caught error to one carrying a partial-write report. */
|
|
@@ -54,10 +64,15 @@ function readFailures(err, dataArray) {
|
|
|
54
64
|
*/
|
|
55
65
|
async function createMany(Model, dataArray, options = {}) {
|
|
56
66
|
try {
|
|
57
|
-
|
|
67
|
+
const insertOptions = {
|
|
58
68
|
session: options.session,
|
|
59
69
|
ordered: options.ordered === true
|
|
60
|
-
}
|
|
70
|
+
};
|
|
71
|
+
const wc = options.queryOptions?.writeConcern;
|
|
72
|
+
if (wc) Object.assign(insertOptions, { writeConcern: wc });
|
|
73
|
+
const bound = options.queryOptions?.maxTimeMS;
|
|
74
|
+
if (bound !== void 0) Object.assign(insertOptions, { timeoutMS: bound });
|
|
75
|
+
return await Model.insertMany(dataArray, insertOptions);
|
|
61
76
|
} catch (err) {
|
|
62
77
|
const inserted = err.insertedDocs;
|
|
63
78
|
const failed = readFailures(err, dataArray);
|
|
@@ -965,7 +980,7 @@ async function facet(Model, facets, options = {}) {
|
|
|
965
980
|
*/
|
|
966
981
|
async function distinct(Model, field, query = {}, options = {}) {
|
|
967
982
|
const q = Model.distinct(field, query).session(options.session ?? null);
|
|
968
|
-
|
|
983
|
+
applyToQuery(q, options.queryOptions ?? {});
|
|
969
984
|
return q;
|
|
970
985
|
}
|
|
971
986
|
/**
|
|
@@ -1026,7 +1041,9 @@ async function deleteById(Model, id, options = {}) {
|
|
|
1026
1041
|
...options.query,
|
|
1027
1042
|
_id: id
|
|
1028
1043
|
};
|
|
1029
|
-
|
|
1044
|
+
const q = Model.findOneAndDelete(query).session(options.session ?? null);
|
|
1045
|
+
applyToQuery(q, options.queryOptions ?? {});
|
|
1046
|
+
if (!await q) return null;
|
|
1030
1047
|
return {
|
|
1031
1048
|
message: "Deleted successfully",
|
|
1032
1049
|
id: String(id)
|
|
@@ -1047,7 +1064,9 @@ async function deleteMany(Model, query, options = {}) {
|
|
|
1047
1064
|
* Delete by query. Returns `null` on miss unless `throwOnNotFound: true`.
|
|
1048
1065
|
*/
|
|
1049
1066
|
async function deleteByQuery(Model, query, options = {}) {
|
|
1050
|
-
const
|
|
1067
|
+
const q = Model.findOneAndDelete(query).session(options.session ?? null);
|
|
1068
|
+
applyToQuery(q, options.queryOptions ?? {});
|
|
1069
|
+
const document = await q;
|
|
1051
1070
|
if (!document) {
|
|
1052
1071
|
if (options.throwOnNotFound === true) throw createError(404, "Document not found");
|
|
1053
1072
|
return null;
|
|
@@ -1132,7 +1151,7 @@ async function getById(Model, id, options = {}) {
|
|
|
1132
1151
|
if (options.populate) query.populate(parsePopulate$1(options.populate));
|
|
1133
1152
|
if (options.lean) query.lean();
|
|
1134
1153
|
if (options.session) query.session(options.session);
|
|
1135
|
-
|
|
1154
|
+
applyToQuery(query, options.queryOptions ?? {});
|
|
1136
1155
|
const document = await query.exec();
|
|
1137
1156
|
if (!document && options.throwOnNotFound === true) throw createError(404, "Document not found");
|
|
1138
1157
|
return document;
|
|
@@ -1153,7 +1172,7 @@ async function getByQuery(Model, query, options = {}) {
|
|
|
1153
1172
|
if (options.sort) mongoQuery.sort(options.sort);
|
|
1154
1173
|
if (options.lean) mongoQuery.lean();
|
|
1155
1174
|
if (options.session) mongoQuery.session(options.session);
|
|
1156
|
-
|
|
1175
|
+
applyToQuery(mongoQuery, options.queryOptions ?? {});
|
|
1157
1176
|
const document = await mongoQuery.exec();
|
|
1158
1177
|
if (!document && options.throwOnNotFound === true) throw createError(404, "Document not found");
|
|
1159
1178
|
return document;
|
|
@@ -1180,7 +1199,7 @@ async function getAll(Model, query = {}, options = {}) {
|
|
|
1180
1199
|
if (options.skip) mongoQuery = mongoQuery.skip(options.skip);
|
|
1181
1200
|
if (options.lean !== false) mongoQuery = mongoQuery.lean();
|
|
1182
1201
|
if (options.session) mongoQuery = mongoQuery.session(options.session);
|
|
1183
|
-
|
|
1202
|
+
applyToQuery(mongoQuery, options.queryOptions ?? {});
|
|
1184
1203
|
return mongoQuery.exec();
|
|
1185
1204
|
}
|
|
1186
1205
|
/**
|
|
@@ -1221,7 +1240,7 @@ async function getOrCreate(Model, query, createData, options = {}) {
|
|
|
1221
1240
|
*/
|
|
1222
1241
|
async function count(Model, query = {}, options = {}) {
|
|
1223
1242
|
const q = Model.countDocuments(query).session(options.session ?? null);
|
|
1224
|
-
|
|
1243
|
+
applyToQuery(q, options.queryOptions ?? {});
|
|
1225
1244
|
return q;
|
|
1226
1245
|
}
|
|
1227
1246
|
/**
|
|
@@ -1229,7 +1248,7 @@ async function count(Model, query = {}, options = {}) {
|
|
|
1229
1248
|
*/
|
|
1230
1249
|
async function exists(Model, query, options = {}) {
|
|
1231
1250
|
const q = Model.exists(query).session(options.session ?? null);
|
|
1232
|
-
|
|
1251
|
+
applyToQuery(q, options.queryOptions ?? {});
|
|
1233
1252
|
return q;
|
|
1234
1253
|
}
|
|
1235
1254
|
//#endregion
|
|
@@ -1245,6 +1264,10 @@ var update_exports = /* @__PURE__ */ __exportAll({
|
|
|
1245
1264
|
updateWithConstraints: () => updateWithConstraints,
|
|
1246
1265
|
updateWithValidation: () => updateWithValidation
|
|
1247
1266
|
});
|
|
1267
|
+
function withQueryOptions(query, queryOptions) {
|
|
1268
|
+
applyToQuery(query, queryOptions ?? {});
|
|
1269
|
+
return query;
|
|
1270
|
+
}
|
|
1248
1271
|
function assertUpdatePipelineAllowed(update, updatePipeline) {
|
|
1249
1272
|
if (Array.isArray(update) && updatePipeline !== true) throw createError(400, "Update pipelines (array updates) are disabled by default; pass `{ updatePipeline: true }` to explicitly allow pipeline-style updates.");
|
|
1250
1273
|
}
|
|
@@ -1266,13 +1289,13 @@ async function update(Model, id, data, options = {}) {
|
|
|
1266
1289
|
...options.query,
|
|
1267
1290
|
_id: id
|
|
1268
1291
|
};
|
|
1269
|
-
return await Model.findOneAndUpdate(query, data, {
|
|
1292
|
+
return await withQueryOptions(Model.findOneAndUpdate(query, data, {
|
|
1270
1293
|
returnDocument: "after",
|
|
1271
1294
|
runValidators: true,
|
|
1272
1295
|
session: options.session,
|
|
1273
1296
|
...options.updatePipeline !== void 0 ? { updatePipeline: options.updatePipeline } : {},
|
|
1274
1297
|
...options.arrayFilters ? { arrayFilters: options.arrayFilters } : {}
|
|
1275
|
-
}).select(options.select || "").populate(parsePopulate(options.populate)).lean(options.lean ?? false) ?? null;
|
|
1298
|
+
}).select(options.select || "").populate(parsePopulate(options.populate)).lean(options.lean ?? false), options.queryOptions) ?? null;
|
|
1276
1299
|
}
|
|
1277
1300
|
/**
|
|
1278
1301
|
* Update with query constraints (optimized)
|
|
@@ -1284,13 +1307,13 @@ async function updateWithConstraints(Model, id, data, constraints = {}, options
|
|
|
1284
1307
|
...constraints,
|
|
1285
1308
|
_id: id
|
|
1286
1309
|
};
|
|
1287
|
-
return await Model.findOneAndUpdate(query, data, {
|
|
1310
|
+
return await withQueryOptions(Model.findOneAndUpdate(query, data, {
|
|
1288
1311
|
returnDocument: "after",
|
|
1289
1312
|
runValidators: true,
|
|
1290
1313
|
session: options.session,
|
|
1291
1314
|
...options.updatePipeline !== void 0 ? { updatePipeline: options.updatePipeline } : {},
|
|
1292
1315
|
...options.arrayFilters ? { arrayFilters: options.arrayFilters } : {}
|
|
1293
|
-
}).select(options.select || "").populate(parsePopulate(options.populate)).lean(options.lean ?? false);
|
|
1316
|
+
}).select(options.select || "").populate(parsePopulate(options.populate)).lean(options.lean ?? false), options.queryOptions);
|
|
1294
1317
|
}
|
|
1295
1318
|
/**
|
|
1296
1319
|
* Update with validation (smart optimization)
|
|
@@ -1347,12 +1370,12 @@ async function updateWithValidation(Model, id, data, validationOptions = {}, opt
|
|
|
1347
1370
|
*/
|
|
1348
1371
|
async function updateMany(Model, query, data, options = {}) {
|
|
1349
1372
|
assertUpdatePipelineAllowed(data, options.updatePipeline);
|
|
1350
|
-
const result = await Model.updateMany(query, data, {
|
|
1373
|
+
const result = await withQueryOptions(Model.updateMany(query, data, {
|
|
1351
1374
|
runValidators: true,
|
|
1352
1375
|
session: options.session,
|
|
1353
1376
|
...options.updatePipeline !== void 0 ? { updatePipeline: options.updatePipeline } : {},
|
|
1354
1377
|
...options.arrayFilters ? { arrayFilters: options.arrayFilters } : {}
|
|
1355
|
-
});
|
|
1378
|
+
}), options.queryOptions);
|
|
1356
1379
|
return {
|
|
1357
1380
|
matchedCount: result.matchedCount,
|
|
1358
1381
|
modifiedCount: result.modifiedCount
|
|
@@ -1363,13 +1386,13 @@ async function updateMany(Model, query, data, options = {}) {
|
|
|
1363
1386
|
*/
|
|
1364
1387
|
async function updateByQuery(Model, query, data, options = {}) {
|
|
1365
1388
|
assertUpdatePipelineAllowed(data, options.updatePipeline);
|
|
1366
|
-
const document = await Model.findOneAndUpdate(query, data, {
|
|
1389
|
+
const document = await withQueryOptions(Model.findOneAndUpdate(query, data, {
|
|
1367
1390
|
returnDocument: "after",
|
|
1368
1391
|
runValidators: true,
|
|
1369
1392
|
session: options.session,
|
|
1370
1393
|
...options.updatePipeline !== void 0 ? { updatePipeline: options.updatePipeline } : {},
|
|
1371
1394
|
...options.arrayFilters ? { arrayFilters: options.arrayFilters } : {}
|
|
1372
|
-
}).select(options.select || "").populate(parsePopulate(options.populate)).lean(options.lean ?? false);
|
|
1395
|
+
}).select(options.select || "").populate(parsePopulate(options.populate)).lean(options.lean ?? false), options.queryOptions);
|
|
1373
1396
|
if (!document && options.throwOnNotFound === true) throw createError(404, "Document not found");
|
|
1374
1397
|
return document;
|
|
1375
1398
|
}
|
|
@@ -1383,7 +1406,7 @@ async function updateByQuery(Model, query, data, options = {}) {
|
|
|
1383
1406
|
async function findOneAndUpdate(Model, filter, update, options = {}) {
|
|
1384
1407
|
assertUpdatePipelineAllowed(update, options.updatePipeline);
|
|
1385
1408
|
const returnDocument = options.returnDocument ?? "after";
|
|
1386
|
-
return await Model.findOneAndUpdate(filter, update, {
|
|
1409
|
+
return await withQueryOptions(Model.findOneAndUpdate(filter, update, {
|
|
1387
1410
|
returnDocument,
|
|
1388
1411
|
upsert: options.upsert ?? false,
|
|
1389
1412
|
runValidators: options.runValidators ?? true,
|
|
@@ -1391,9 +1414,8 @@ async function findOneAndUpdate(Model, filter, update, options = {}) {
|
|
|
1391
1414
|
...options.sort ? { sort: options.sort } : {},
|
|
1392
1415
|
...options.arrayFilters ? { arrayFilters: options.arrayFilters } : {},
|
|
1393
1416
|
...options.collation ? { collation: options.collation } : {},
|
|
1394
|
-
...options.maxTimeMS ? { maxTimeMS: options.maxTimeMS } : {},
|
|
1395
1417
|
...options.updatePipeline !== void 0 ? { updatePipeline: options.updatePipeline } : {}
|
|
1396
|
-
}).select(options.select || "").populate(parsePopulate(options.populate)).lean(options.lean ?? true);
|
|
1418
|
+
}).select(options.select || "").populate(parsePopulate(options.populate)).lean(options.lean ?? true), options.queryOptions);
|
|
1397
1419
|
}
|
|
1398
1420
|
/**
|
|
1399
1421
|
* Increment field
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as getMongooseProjection, a as createMemoryCache, b as createError, c as IdType, d as isObjectIdInstance, f as isValidIdForType, g as getFieldsForUser, h as filterResponseData, i as buildCrudSchemasFromMongooseSchema, l as getSchemaIdType, m as createFieldPreset, n as CrudSchemasFramework, o as LoggerConfig, p as toObjectId, r as buildCrudSchemasFromModel, s as configureLogger, t as toPlain, v as CreateErrorOptions, y as ParseDuplicateKeyOptions } from "../to-plain-
|
|
1
|
+
import { _ as getMongooseProjection, a as createMemoryCache, b as createError, c as IdType, d as isObjectIdInstance, f as isValidIdForType, g as getFieldsForUser, h as filterResponseData, i as buildCrudSchemasFromMongooseSchema, l as getSchemaIdType, m as createFieldPreset, n as CrudSchemasFramework, o as LoggerConfig, p as toObjectId, r as buildCrudSchemasFromModel, s as configureLogger, t as toPlain, v as CreateErrorOptions, y as ParseDuplicateKeyOptions } from "../to-plain-CjgEInWV.mjs";
|
|
2
2
|
import { ClientSession, Model } from "mongoose";
|
|
3
3
|
//#region src/utils/id-chunks.d.ts
|
|
4
4
|
/**
|
package/dist/utils/index.mjs
CHANGED
|
@@ -4,5 +4,5 @@ import { t as configureLogger } from "../logger-K7dPmu2U.mjs";
|
|
|
4
4
|
import { t as createError } from "../error-BuByZwKU.mjs";
|
|
5
5
|
import { i as getMongooseProjection, n as filterResponseData, r as getFieldsForUser, t as createFieldPreset } from "../field-selection-FSQFLpsU.mjs";
|
|
6
6
|
import { n as createMemoryCache, t as toPlain } from "../to-plain-vksRrLtc.mjs";
|
|
7
|
-
import { n as buildCrudSchemasFromMongooseSchema, t as buildCrudSchemasFromModel } from "../mongooseToJsonSchema-
|
|
7
|
+
import { n as buildCrudSchemasFromMongooseSchema, t as buildCrudSchemasFromModel } from "../mongooseToJsonSchema-C3k4ide0.mjs";
|
|
8
8
|
export { DEFAULT_ID_CHUNK, buildCrudSchemasFromModel, buildCrudSchemasFromMongooseSchema, collectIds, configureLogger, createError, createFieldPreset, createMemoryCache, filterResponseData, getFieldsForUser, getMongooseProjection, getSchemaIdType, idChunks, isObjectIdInstance, isValidIdForType, keysetFilter, narrowToIds, selectKeysetChunk, toObjectId, toPlain };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as collectIds, r as idChunks, t as DEFAULT_ID_CHUNK } from "./id-chunks-BmAwsqNk.mjs";
|
|
2
|
-
import { i as ALL_OPERATIONS, o as OP_REGISTRY } from "./Repository-
|
|
3
|
-
import { w as upsert } from "./update-
|
|
2
|
+
import { i as ALL_OPERATIONS, o as OP_REGISTRY } from "./Repository-CYhSC9ut.mjs";
|
|
3
|
+
import { w as upsert } from "./update-WgeAUJ_I.mjs";
|
|
4
4
|
import { n as warn } from "./logger-K7dPmu2U.mjs";
|
|
5
5
|
import { t as createError } from "./error-BuByZwKU.mjs";
|
|
6
|
-
import { c as tenantContextKeysOf, o as forwardScope } from "./timestamp.plugin-
|
|
6
|
+
import { c as tenantContextKeysOf, o as forwardScope } from "./timestamp.plugin-zfdLYZiO.mjs";
|
|
7
7
|
import { r as getFieldsForUser } from "./field-selection-FSQFLpsU.mjs";
|
|
8
8
|
import mongoose from "mongoose";
|
|
9
9
|
import { HOOK_PRIORITY } from "@classytic/repo-core/hooks";
|
|
@@ -749,6 +749,7 @@ const STRATEGY_OPS = /* @__PURE__ */ new Set([
|
|
|
749
749
|
"updateMany",
|
|
750
750
|
"deleteMany",
|
|
751
751
|
"bulkWrite",
|
|
752
|
+
"bulkUpsert",
|
|
752
753
|
"claim"
|
|
753
754
|
]);
|
|
754
755
|
function immutableStatesPlugin(options) {
|
|
@@ -825,6 +826,17 @@ function immutableStatesPlugin(options) {
|
|
|
825
826
|
};
|
|
826
827
|
repo.on("before:updateMany", guardMany("updateMany"));
|
|
827
828
|
repo.on("before:deleteMany", guardMany("deleteMany"));
|
|
829
|
+
repo.on("before:bulkUpsert", async (ctx) => {
|
|
830
|
+
if (ctx[internalFlag]) return;
|
|
831
|
+
const filters = (ctx.operations ?? []).flatMap((op) => op.updateOne?.filter ? [op.updateOne.filter] : []);
|
|
832
|
+
if (filters.length === 0) return;
|
|
833
|
+
const hit = await Model.exists({ $and: [{ $or: filters }, { [field]: { $in: [...frozen] } }] }).session(ctx.session ?? null);
|
|
834
|
+
if (hit) throwViolation({
|
|
835
|
+
id: hit._id,
|
|
836
|
+
operation: "bulkUpsert",
|
|
837
|
+
state: void 0
|
|
838
|
+
});
|
|
839
|
+
});
|
|
828
840
|
repo.on("before:bulkWrite", (ctx) => {
|
|
829
841
|
if (ctx[internalFlag]) return;
|
|
830
842
|
throwViolation({
|
package/dist/{validation-chain.plugin-DYp9E7K2.d.mts → validation-chain.plugin-CTcNJCmV.d.mts}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { h as RepositoryInstance, l as Plugin, p as RepositoryContext } from "./repository-
|
|
3
|
-
import { c as ValidationChainOptions, i as Logger, l as ValidatorDefinition, o as SoftDeleteOptions, r as FieldPreset, t as CascadeOptions } from "./plugin-options-
|
|
1
|
+
import { A as ObjectId, F as SortSpec, N as SelectSpec, j as PopulateSpec } from "./pagination-D6psses0.mjs";
|
|
2
|
+
import { h as RepositoryInstance, l as Plugin, p as RepositoryContext } from "./repository-DNHfjAZX.mjs";
|
|
3
|
+
import { c as ValidationChainOptions, i as Logger, l as ValidatorDefinition, o as SoftDeleteOptions, r as FieldPreset, t as CascadeOptions } from "./plugin-options-CRhIvSzx.mjs";
|
|
4
4
|
import { BulkWriteResult } from "@classytic/repo-core/repository";
|
|
5
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
5
|
import { OffsetPaginationResult } from "@classytic/repo-core/pagination";
|
|
6
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
7
|
//#region src/plugins/aggregate-helpers.plugin.d.ts
|
|
8
8
|
/**
|
|
9
9
|
* Aggregate helpers plugin
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classytic/mongokit",
|
|
3
|
-
"version": "3.40.
|
|
3
|
+
"version": "3.40.1",
|
|
4
4
|
"description": "Production-grade MongoDB repositories - smart pagination, events, and plugins. Built on @classytic/repo-core.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -88,6 +88,10 @@
|
|
|
88
88
|
"types": "./dist/testkit/index.d.mts",
|
|
89
89
|
"default": "./dist/testkit/index.mjs"
|
|
90
90
|
},
|
|
91
|
+
"./read-model": {
|
|
92
|
+
"types": "./dist/read-model/index.d.mts",
|
|
93
|
+
"default": "./dist/read-model/index.mjs"
|
|
94
|
+
},
|
|
91
95
|
"./kernel-conformance": {
|
|
92
96
|
"types": "./dist/kernel-conformance/index.d.mts",
|
|
93
97
|
"default": "./dist/kernel-conformance/index.mjs"
|
|
@@ -142,7 +146,7 @@
|
|
|
142
146
|
},
|
|
143
147
|
"homepage": "https://github.com/classytic/mongokit#readme",
|
|
144
148
|
"peerDependencies": {
|
|
145
|
-
"@classytic/repo-core": ">=0.
|
|
149
|
+
"@classytic/repo-core": ">=0.31.0",
|
|
146
150
|
"mongodb-memory-server": ">=10.4.3",
|
|
147
151
|
"mongoose": ">=9.4.1"
|
|
148
152
|
},
|
|
@@ -195,13 +199,14 @@
|
|
|
195
199
|
"@better-auth/mongo-adapter": "^1.6.29",
|
|
196
200
|
"@biomejs/biome": "^2.5.8",
|
|
197
201
|
"@classytic/dev-tools": "^0.2.0",
|
|
198
|
-
"@classytic/repo-core": "^0.
|
|
202
|
+
"@classytic/repo-core": "^0.31.0",
|
|
199
203
|
"@types/node": "^26.2.0",
|
|
200
204
|
"@vitest/coverage-v8": "^4.1.10",
|
|
201
205
|
"ajv": "^8.20.0",
|
|
202
206
|
"ajv-formats": "^3.0.1",
|
|
203
207
|
"better-auth": "^1.6.29",
|
|
204
208
|
"dotenv": "^17.4.2",
|
|
209
|
+
"fast-check": "^4.7.0",
|
|
205
210
|
"knip": "^6.32.2",
|
|
206
211
|
"mongodb": "^7.5.0",
|
|
207
212
|
"mongodb-memory-server": "^11.2.0",
|