@classytic/mongokit 3.5.0 → 3.5.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/dist/index.d.mts
CHANGED
|
@@ -844,7 +844,9 @@ declare class Repository<TDoc = unknown> {
|
|
|
844
844
|
* const all = await repo.findAll({ status: 'active' });
|
|
845
845
|
* const allLean = await repo.findAll({}, { select: 'name email', lean: true });
|
|
846
846
|
*/
|
|
847
|
-
findAll(filters?: Record<string, unknown>, options?: OperationOptions
|
|
847
|
+
findAll(filters?: Record<string, unknown>, options?: OperationOptions & {
|
|
848
|
+
sort?: SortSpec | string;
|
|
849
|
+
}): Promise<TDoc[]>;
|
|
848
850
|
/**
|
|
849
851
|
* Unified pagination - auto-detects offset vs keyset based on params
|
|
850
852
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { a as warn, n as parseDuplicateKeyError, r as configureLogger, t as crea
|
|
|
2
2
|
import { y as LookupBuilder } from "./update-DcWUpWBk.mjs";
|
|
3
3
|
import { t as actions_exports } from "./actions/index.mjs";
|
|
4
4
|
import { t as PaginationEngine } from "./PaginationEngine-DCs-zKwZ.mjs";
|
|
5
|
-
import { A as aggregateHelpersPlugin, C as HOOK_PRIORITY, D as AuditTrailQuery, E as batchOperationsPlugin, O as auditTrailPlugin, S as cachePlugin, T as AggregationBuilder, _ as dateSequentialId, a as uniqueField, b as sequentialId, c as subdocumentPlugin, d as multiTenantPlugin, f as mongoOperationsPlugin, g as customIdPlugin, h as elasticSearchPlugin, i as requireField, k as auditLogPlugin, l as softDeletePlugin, m as fieldFilterPlugin, n as blockIf, o as validationChainPlugin, p as methodRegistryPlugin, r as immutableField, s as timestampPlugin, t as autoInject, u as observabilityPlugin, v as getNextSequence, w as Repository, x as cascadePlugin, y as prefixedId } from "./validation-chain.plugin-
|
|
5
|
+
import { A as aggregateHelpersPlugin, C as HOOK_PRIORITY, D as AuditTrailQuery, E as batchOperationsPlugin, O as auditTrailPlugin, S as cachePlugin, T as AggregationBuilder, _ as dateSequentialId, a as uniqueField, b as sequentialId, c as subdocumentPlugin, d as multiTenantPlugin, f as mongoOperationsPlugin, g as customIdPlugin, h as elasticSearchPlugin, i as requireField, k as auditLogPlugin, l as softDeletePlugin, m as fieldFilterPlugin, n as blockIf, o as validationChainPlugin, p as methodRegistryPlugin, r as immutableField, s as timestampPlugin, t as autoInject, u as observabilityPlugin, v as getNextSequence, w as Repository, x as cascadePlugin, y as prefixedId } from "./validation-chain.plugin-DboBJfGs.mjs";
|
|
6
6
|
import { i as getMongooseProjection, n as filterResponseData, r as getFieldsForUser, t as createFieldPreset } from "./field-selection-reyDRzXf.mjs";
|
|
7
7
|
import { a as isFieldUpdateAllowed, i as getSystemManagedFields, n as buildCrudSchemasFromMongooseSchema, o as validateUpdateBody, r as getImmutableFields, s as createMemoryCache, t as buildCrudSchemasFromModel } from "./mongooseToJsonSchema-B6Qyl8BK.mjs";
|
|
8
8
|
import mongoose from "mongoose";
|
package/dist/plugins/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as aggregateHelpersPlugin, D as AuditTrailQuery, E as batchOperationsPlugin, O as auditTrailPlugin, S as cachePlugin, _ as dateSequentialId, a as uniqueField, b as sequentialId, c as subdocumentPlugin, d as multiTenantPlugin, f as mongoOperationsPlugin, g as customIdPlugin, h as elasticSearchPlugin, i as requireField, k as auditLogPlugin, l as softDeletePlugin, m as fieldFilterPlugin, n as blockIf, o as validationChainPlugin, p as methodRegistryPlugin, r as immutableField, s as timestampPlugin, t as autoInject, u as observabilityPlugin, v as getNextSequence, x as cascadePlugin, y as prefixedId } from "../validation-chain.plugin-
|
|
1
|
+
import { A as aggregateHelpersPlugin, D as AuditTrailQuery, E as batchOperationsPlugin, O as auditTrailPlugin, S as cachePlugin, _ as dateSequentialId, a as uniqueField, b as sequentialId, c as subdocumentPlugin, d as multiTenantPlugin, f as mongoOperationsPlugin, g as customIdPlugin, h as elasticSearchPlugin, i as requireField, k as auditLogPlugin, l as softDeletePlugin, m as fieldFilterPlugin, n as blockIf, o as validationChainPlugin, p as methodRegistryPlugin, r as immutableField, s as timestampPlugin, t as autoInject, u as observabilityPlugin, v as getNextSequence, x as cascadePlugin, y as prefixedId } from "../validation-chain.plugin-DboBJfGs.mjs";
|
|
2
2
|
export { AuditTrailQuery, aggregateHelpersPlugin, auditLogPlugin, auditTrailPlugin, autoInject, batchOperationsPlugin, blockIf, cachePlugin, cascadePlugin, customIdPlugin, dateSequentialId, elasticSearchPlugin, fieldFilterPlugin, getNextSequence, immutableField, methodRegistryPlugin, mongoOperationsPlugin, multiTenantPlugin, observabilityPlugin, prefixedId, requireField, sequentialId, softDeletePlugin, subdocumentPlugin, timestampPlugin, uniqueField, validationChainPlugin };
|
|
@@ -1425,6 +1425,8 @@ var Repository = class {
|
|
|
1425
1425
|
const resolvedFilters = context.filters ?? filters;
|
|
1426
1426
|
try {
|
|
1427
1427
|
const query = this.Model.find(resolvedFilters);
|
|
1428
|
+
const sortSpec = context.sort || options.sort;
|
|
1429
|
+
if (sortSpec) query.sort(this._parseSort(sortSpec));
|
|
1428
1430
|
const selectSpec = context.select || options.select;
|
|
1429
1431
|
if (selectSpec) query.select(selectSpec);
|
|
1430
1432
|
if (options.populate || context.populate) query.populate(this._parsePopulate(context.populate || options.populate));
|
|
@@ -1487,7 +1489,10 @@ var Repository = class {
|
|
|
1487
1489
|
});
|
|
1488
1490
|
return cachedResult;
|
|
1489
1491
|
}
|
|
1490
|
-
if (params.noPagination) return this.findAll(params.filters ?? {},
|
|
1492
|
+
if (params.noPagination) return this.findAll(context.filters ?? params.filters ?? {}, {
|
|
1493
|
+
...options,
|
|
1494
|
+
sort: context.sort ?? params.sort
|
|
1495
|
+
});
|
|
1491
1496
|
const filters = context.filters ?? params.filters ?? {};
|
|
1492
1497
|
const search = context.search ?? params.search;
|
|
1493
1498
|
const sort = context.sort ?? params.sort ?? "-createdAt";
|
package/package.json
CHANGED