@classytic/mongokit 3.8.0 → 3.10.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.
@@ -1,5 +1,6 @@
1
- import { Ct as ValidatorDefinition, H as ObjectId, L as Logger, Q as PopulateSpec, T as FieldPreset, W as OffsetPaginationResult, Y as Plugin, ct as SelectSpec, dt as SoftDeleteOptions, f as CascadeOptions, l as CacheOptions, mt as SortSpec, rt as RepositoryInstance, tt as RepositoryContext, u as CacheStats, xt as ValidationChainOptions } from "./types-D57SZJeE.mjs";
1
+ import { $ as RepositoryContext, K as Plugin, P as Logger, V as OffsetPaginationResult, Y as PopulateSpec, at as SelectSpec, ct as SoftDeleteOptions, dt as SortSpec, f as CascadeOptions, l as CacheOptions, tt as RepositoryInstance, u as CacheStats, vt as ValidationChainOptions, w as FieldPreset, yt as ValidatorDefinition, z as ObjectId } from "./types-Bbr54g--.mjs";
2
2
  import mongoose, { ClientSession } from "mongoose";
3
+ import { BulkWriteResult } from "@classytic/repo-core/repository";
3
4
  import { AsyncLocalStorage } from "node:async_hooks";
4
5
 
5
6
  //#region src/plugins/aggregate-helpers.plugin.d.ts
@@ -256,39 +257,6 @@ interface AuditTrailMethods {
256
257
  * await repo.deleteMany({ status: 'deleted' });
257
258
  */
258
259
  declare function batchOperationsPlugin(): Plugin;
259
- /**
260
- * Type interface for repositories using batchOperationsPlugin
261
- *
262
- * @example
263
- * ```typescript
264
- * import { Repository, methodRegistryPlugin, batchOperationsPlugin } from '@classytic/mongokit';
265
- * import type { BatchOperationsMethods } from '@classytic/mongokit';
266
- *
267
- * class ProductRepo extends Repository<IProduct> {}
268
- *
269
- * type ProductRepoWithBatch = ProductRepo & BatchOperationsMethods;
270
- *
271
- * const repo = new ProductRepo(ProductModel, [
272
- * methodRegistryPlugin(),
273
- * batchOperationsPlugin(),
274
- * ]) as ProductRepoWithBatch;
275
- *
276
- * // TypeScript autocomplete works!
277
- * await repo.updateMany({ status: 'pending' }, { status: 'active' });
278
- * await repo.deleteMany({ status: 'archived' });
279
- * ```
280
- */
281
- /** Bulk write result */
282
- interface BulkWriteResult {
283
- ok: number;
284
- insertedCount: number;
285
- upsertedCount: number;
286
- matchedCount: number;
287
- modifiedCount: number;
288
- deletedCount: number;
289
- insertedIds: Record<number, unknown>;
290
- upsertedIds: Record<number, unknown>;
291
- }
292
260
  interface BatchOperationsMethods {
293
261
  /**
294
262
  * Update multiple documents matching the query
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@classytic/mongokit",
3
- "version": "3.8.0",
4
- "description": "Production-grade MongoDB repositories with zero dependencies - smart pagination, events, and plugins",
3
+ "version": "3.10.1",
4
+ "description": "Production-grade MongoDB repositories - smart pagination, events, and plugins. Built on @classytic/repo-core.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "main": "./dist/index.mjs",
@@ -93,7 +93,8 @@
93
93
  },
94
94
  "homepage": "https://github.com/classytic/mongokit#readme",
95
95
  "peerDependencies": {
96
- "mongoose": ">=9.4.1"
96
+ "mongoose": ">=9.4.1",
97
+ "@classytic/repo-core": ">=0.1.0"
97
98
  },
98
99
  "engines": {
99
100
  "node": ">=22"
@@ -124,6 +125,7 @@
124
125
  "devDependencies": {
125
126
  "@arethetypeswrong/cli": "^0.18.2",
126
127
  "@biomejs/biome": "^2.4.10",
128
+ "@classytic/repo-core": ">=0.1.0",
127
129
  "@types/node": "^22.0.0",
128
130
  "@vitest/coverage-v8": "^3.2.4",
129
131
  "ajv": "^8.18.0",