@classytic/mongokit 3.4.0 → 3.4.2

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
@@ -1,8 +1,8 @@
1
- import { $ as SchemaBuilderOptions, A as KeysetPaginationOptions, B as PaginationResult, C as GroupResult, D as InferRawDoc, E as InferDocument, F as ObjectId, G as PopulateSpec, H as Plugin, I as OffsetPaginationOptions, J as RepositoryEvent, K as ReadPreferenceType, L as OffsetPaginationResult, M as Logger, N as MinMaxResult, O as JsonSchema, P as NonNullableFields, Q as RequiredBy, R as OperationOptions, S as FieldRules, St as LookupOptions, T as HttpError, U as PluginFunction, V as PartialBy, W as PluginType, X as RepositoryOperation, Y as RepositoryInstance, Z as RepositoryOptions, _ as DeleteResult, _t as IController, a as AnyModel, at as SortSpec, b as EventPhase, bt as IResponseFormatter, c as CacheOptions, ct as UpdateManyResult, d as CascadeRelation, dt as UserContext, et as SelectSpec, f as CreateInput, ft as ValidationChainOptions, g as DeepPartial, gt as WithTransactionOptions, h as DecodedCursor, ht as WithPlugins, i as AnyDocument, it as SortDirection, j as KeysetPaginationResult, k as KeysOfType, l as CacheStats, lt as UpdateOptions, m as CrudSchemas, mt as ValidatorDefinition, n as AggregatePaginationResult, nt as SoftDeleteOptions, o as CacheAdapter, ot as Strict, p as CreateOptions, pt as ValidationResult, q as RepositoryContext, r as AllPluginMethods, rt as SoftDeleteRepository, s as CacheOperationOptions, st as UpdateInput, t as AggregatePaginationOptions, tt as SoftDeleteFilterMode, u as CascadeOptions, ut as UpdateWithValidationResult, v as EventHandlers, vt as IControllerResponse, w as HookMode, x as FieldPreset, xt as LookupBuilder, y as EventPayload, yt as IRequestContext, z as PaginationConfig } from "./types-BlCwDszq.mjs";
2
- import { t as index_d_exports } from "./index-Df3ernpC.mjs";
1
+ import { $ as RequiredBy, A as KeysOfType, B as PaginationConfig, C as FieldRules, Ct as LookupOptions, D as InferDocument, E as HttpError, F as NonNullableFields, G as PluginType, H as PartialBy, I as ObjectId, J as RepositoryContext, K as PopulateSpec, L as OffsetPaginationOptions, M as KeysetPaginationResult, N as Logger, O as InferRawDoc, P as MinMaxResult, Q as RepositoryOptions, R as OffsetPaginationResult, S as FieldPreset, St as LookupBuilder, T as HookMode, U as Plugin, V as PaginationResult, W as PluginFunction, X as RepositoryInstance, Y as RepositoryEvent, Z as RepositoryOperation, _ as DeepPartial, _t as WithTransactionOptions, a as AnyModel, at as SortDirection, b as EventPayload, bt as IRequestContext, c as CacheOptions, ct as UpdateInput, d as CascadeRelation, dt as UpdateWithValidationResult, et as SchemaBuilderOptions, f as CollationOptions, ft as UserContext, g as DecodedCursor, gt as WithPlugins, h as CrudSchemas, ht as ValidatorDefinition, i as AnyDocument, it as SoftDeleteRepository, j as KeysetPaginationOptions, k as JsonSchema, l as CacheStats, lt as UpdateManyResult, m as CreateOptions, mt as ValidationResult, n as AggregatePaginationResult, nt as SoftDeleteFilterMode, o as CacheAdapter, ot as SortSpec, p as CreateInput, pt as ValidationChainOptions, q as ReadPreferenceType, r as AllPluginMethods, rt as SoftDeleteOptions, s as CacheOperationOptions, st as Strict, t as AggregatePaginationOptions, tt as SelectSpec, u as CascadeOptions, ut as UpdateOptions, v as DeleteResult, vt as IController, w as GroupResult, x as EventPhase, xt as IResponseFormatter, y as EventHandlers, yt as IControllerResponse, z as OperationOptions } from "./types-COINbsdL.mjs";
2
+ import { t as index_d_exports } from "./index-BuoZIZ15.mjs";
3
3
  import { PaginationEngine } from "./pagination/PaginationEngine.mjs";
4
- import { A as dateSequentialId, B as AuditEntry, C as elasticSearchPlugin, D as PrefixedIdOptions, E as IdGenerator, F as CacheMethods, G as AuditTrailOptions, H as AuditQueryOptions, I as cachePlugin, J as auditLogPlugin, K as AuditTrailQuery, L as BatchOperationsMethods, M as prefixedId, N as sequentialId, O as SequentialIdOptions, P as cascadePlugin, R as BulkWriteResult, S as ElasticSearchOptions, T as DateSequentialIdOptions, U as AuditQueryResult, V as AuditOperation, W as AuditTrailMethods, X as aggregateHelpersPlugin, Y as AggregateHelpersMethods, _ as MongoOperationsMethods, a as uniqueField, b as methodRegistryPlugin, c as SubdocumentMethods, d as softDeletePlugin, f as ObservabilityOptions, g as multiTenantPlugin, h as MultiTenantOptions, i as requireField, j as getNextSequence, k as customIdPlugin, l as subdocumentPlugin, m as observabilityPlugin, n as blockIf, o as validationChainPlugin, p as OperationMetric, q as auditTrailPlugin, r as immutableField, s as timestampPlugin, t as autoInject, u as SoftDeleteMethods, v as mongoOperationsPlugin, w as CustomIdOptions, x as fieldFilterPlugin, z as batchOperationsPlugin } from "./validation-chain.plugin-DxqiHv-E.mjs";
5
- import { a as isFieldUpdateAllowed, c as configureLogger, d as getFieldsForUser, f as getMongooseProjection, i as getSystemManagedFields, l as createFieldPreset, m as parseDuplicateKeyError, n as buildCrudSchemasFromMongooseSchema, o as validateUpdateBody, p as createError, r as getImmutableFields, s as createMemoryCache, t as buildCrudSchemasFromModel, u as filterResponseData } from "./mongooseToJsonSchema-BqgVOlrR.mjs";
4
+ import { A as dateSequentialId, B as AuditEntry, C as elasticSearchPlugin, D as PrefixedIdOptions, E as IdGenerator, F as CacheMethods, G as AuditTrailOptions, H as AuditQueryOptions, I as cachePlugin, J as auditLogPlugin, K as AuditTrailQuery, L as BatchOperationsMethods, M as prefixedId, N as sequentialId, O as SequentialIdOptions, P as cascadePlugin, R as BulkWriteResult, S as ElasticSearchOptions, T as DateSequentialIdOptions, U as AuditQueryResult, V as AuditOperation, W as AuditTrailMethods, X as aggregateHelpersPlugin, Y as AggregateHelpersMethods, _ as MongoOperationsMethods, a as uniqueField, b as methodRegistryPlugin, c as SubdocumentMethods, d as softDeletePlugin, f as ObservabilityOptions, g as multiTenantPlugin, h as MultiTenantOptions, i as requireField, j as getNextSequence, k as customIdPlugin, l as subdocumentPlugin, m as observabilityPlugin, n as blockIf, o as validationChainPlugin, p as OperationMetric, q as auditTrailPlugin, r as immutableField, s as timestampPlugin, t as autoInject, u as SoftDeleteMethods, v as mongoOperationsPlugin, w as CustomIdOptions, x as fieldFilterPlugin, z as batchOperationsPlugin } from "./validation-chain.plugin-BNoaKDOm.mjs";
5
+ import { a as isFieldUpdateAllowed, c as configureLogger, d as getFieldsForUser, f as getMongooseProjection, i as getSystemManagedFields, l as createFieldPreset, m as parseDuplicateKeyError, n as buildCrudSchemasFromMongooseSchema, o as validateUpdateBody, p as createError, r as getImmutableFields, s as createMemoryCache, t as buildCrudSchemasFromModel, u as filterResponseData } from "./mongooseToJsonSchema-RX9YfJLu.mjs";
6
6
  import * as _$mongoose from "mongoose";
7
7
  import { ClientSession, Expression, Model, PipelineStage, PopulateOptions } from "mongoose";
8
8
 
@@ -873,7 +873,8 @@ declare class Repository<TDoc = any> {
873
873
  maxTimeMS?: number;
874
874
  countStrategy?: 'exact' | 'estimated' | 'none';
875
875
  readPreference?: ReadPreferenceType; /** Advanced populate options (from QueryParser or Arc's BaseController) */
876
- populateOptions?: PopulateOptions[]; /** Lookup configurations for $lookup joins (from QueryParser or manual) */
876
+ populateOptions?: PopulateOptions[]; /** Collation for locale-aware string comparison */
877
+ collation?: CollationOptions; /** Lookup configurations for $lookup joins (from QueryParser or manual) */
877
878
  lookups?: LookupOptions[];
878
879
  }, options?: {
879
880
  select?: SelectSpec;
@@ -984,15 +985,20 @@ declare class Repository<TDoc = any> {
984
985
  lookups: LookupOptions[];
985
986
  sort?: SortSpec | string;
986
987
  page?: number;
988
+ after?: string;
987
989
  limit?: number;
988
990
  select?: SelectSpec;
989
991
  session?: ClientSession;
990
992
  readPreference?: ReadPreferenceType;
993
+ collation?: CollationOptions;
994
+ countStrategy?: 'exact' | 'estimated' | 'none';
991
995
  }): Promise<{
992
996
  data: TDoc[];
993
- total?: number;
997
+ total: number;
994
998
  page?: number;
995
- limit?: number;
999
+ limit: number;
1000
+ next?: string | null;
1001
+ hasMore?: boolean;
996
1002
  }>;
997
1003
  /**
998
1004
  * Create an aggregation builder for this model
@@ -1104,4 +1110,4 @@ declare class Repository<TDoc = any> {
1104
1110
  */
1105
1111
  declare function createRepository<TDoc>(Model: _$mongoose.Model<TDoc, any, any, any>, plugins?: PluginType[], paginationConfig?: PaginationConfig, options?: RepositoryOptions): Repository<TDoc>;
1106
1112
  //#endregion
1107
- export { type AggregateHelpersMethods, type AggregatePaginationOptions, type AggregatePaginationResult, AggregationBuilder, type AllPluginMethods, type AnyDocument, type AnyModel, type AuditEntry, type AuditOperation, type AuditQueryOptions, type AuditQueryResult, type AuditTrailMethods, type AuditTrailOptions, AuditTrailQuery, type BatchOperationsMethods, type BulkWriteResult, type CacheAdapter, type CacheMethods, type CacheOperationOptions, type CacheOptions, type CacheStats, type CascadeOptions, type CascadeRelation, type CreateInput, type CreateOptions, type CrudSchemas, type CustomIdOptions, type DateSequentialIdOptions, type DecodedCursor, type DeepPartial, type DeleteResult, type ElasticSearchOptions, type EventHandlers, type EventPayload, type EventPhase, type FieldPreset, type FieldRules, type FilterQuery, type GroupResult, HOOK_PRIORITY, type HookMode, type HttpError, type IController, type IControllerResponse, type IRequestContext, type IResponseFormatter, type IdGenerator, type InferDocument, type InferRawDoc, type JsonSchema, type KeysOfType, type KeysetPaginationOptions, type KeysetPaginationResult, type Logger, LookupBuilder, type LookupOptions, type MinMaxResult, type MongoOperationsMethods, type MultiTenantOptions, type NonNullableFields, type ObjectId, type ObservabilityOptions, type OffsetPaginationOptions, type OffsetPaginationResult, type OperationMetric, type OperationOptions, type PaginationConfig, PaginationEngine, type PaginationResult, type ParsedQuery, type PartialBy, type Plugin, type PluginFunction, type PluginType, type PopulateOption, type PopulateSpec, type PrefixedIdOptions, QueryParser, type QueryParserOptions, type ReadPreferenceType, Repository, Repository as default, type RepositoryContext, type RepositoryEvent, type RepositoryInstance, type RepositoryOperation, type RepositoryOptions, type RequiredBy, type SchemaBuilderOptions, type SearchMode, type SelectSpec, type SequentialIdOptions, type SoftDeleteFilterMode, type SoftDeleteMethods, type SoftDeleteOptions, type SoftDeleteRepository, type SortDirection, type SortSpec, type Strict, type SubdocumentMethods, type UpdateInput, type UpdateManyResult, type UpdateOptions, type UpdateWithValidationResult, type UserContext, type ValidationChainOptions, type ValidationResult, type ValidatorDefinition, type WithPlugins, type WithTransactionOptions, index_d_exports as actions, aggregateHelpersPlugin, auditLogPlugin, auditTrailPlugin, autoInject, batchOperationsPlugin, blockIf, buildCrudSchemasFromModel, buildCrudSchemasFromMongooseSchema, cachePlugin, cascadePlugin, configureLogger, createError, createFieldPreset, createMemoryCache, createRepository, customIdPlugin, dateSequentialId, elasticSearchPlugin, fieldFilterPlugin, filterResponseData, getFieldsForUser, getImmutableFields, getMongooseProjection, getNextSequence, getSystemManagedFields, immutableField, isFieldUpdateAllowed, methodRegistryPlugin, mongoOperationsPlugin, multiTenantPlugin, observabilityPlugin, parseDuplicateKeyError, prefixedId, requireField, sequentialId, softDeletePlugin, subdocumentPlugin, timestampPlugin, uniqueField, validateUpdateBody, validationChainPlugin };
1113
+ export { type AggregateHelpersMethods, type AggregatePaginationOptions, type AggregatePaginationResult, AggregationBuilder, type AllPluginMethods, type AnyDocument, type AnyModel, type AuditEntry, type AuditOperation, type AuditQueryOptions, type AuditQueryResult, type AuditTrailMethods, type AuditTrailOptions, AuditTrailQuery, type BatchOperationsMethods, type BulkWriteResult, type CacheAdapter, type CacheMethods, type CacheOperationOptions, type CacheOptions, type CacheStats, type CascadeOptions, type CascadeRelation, type CollationOptions, type CreateInput, type CreateOptions, type CrudSchemas, type CustomIdOptions, type DateSequentialIdOptions, type DecodedCursor, type DeepPartial, type DeleteResult, type ElasticSearchOptions, type EventHandlers, type EventPayload, type EventPhase, type FieldPreset, type FieldRules, type FilterQuery, type GroupResult, HOOK_PRIORITY, type HookMode, type HttpError, type IController, type IControllerResponse, type IRequestContext, type IResponseFormatter, type IdGenerator, type InferDocument, type InferRawDoc, type JsonSchema, type KeysOfType, type KeysetPaginationOptions, type KeysetPaginationResult, type Logger, LookupBuilder, type LookupOptions, type MinMaxResult, type MongoOperationsMethods, type MultiTenantOptions, type NonNullableFields, type ObjectId, type ObservabilityOptions, type OffsetPaginationOptions, type OffsetPaginationResult, type OperationMetric, type OperationOptions, type PaginationConfig, PaginationEngine, type PaginationResult, type ParsedQuery, type PartialBy, type Plugin, type PluginFunction, type PluginType, type PopulateOption, type PopulateSpec, type PrefixedIdOptions, QueryParser, type QueryParserOptions, type ReadPreferenceType, Repository, Repository as default, type RepositoryContext, type RepositoryEvent, type RepositoryInstance, type RepositoryOperation, type RepositoryOptions, type RequiredBy, type SchemaBuilderOptions, type SearchMode, type SelectSpec, type SequentialIdOptions, type SoftDeleteFilterMode, type SoftDeleteMethods, type SoftDeleteOptions, type SoftDeleteRepository, type SortDirection, type SortSpec, type Strict, type SubdocumentMethods, type UpdateInput, type UpdateManyResult, type UpdateOptions, type UpdateWithValidationResult, type UserContext, type ValidationChainOptions, type ValidationResult, type ValidatorDefinition, type WithPlugins, type WithTransactionOptions, index_d_exports as actions, aggregateHelpersPlugin, auditLogPlugin, auditTrailPlugin, autoInject, batchOperationsPlugin, blockIf, buildCrudSchemasFromModel, buildCrudSchemasFromMongooseSchema, cachePlugin, cascadePlugin, configureLogger, createError, createFieldPreset, createMemoryCache, createRepository, customIdPlugin, dateSequentialId, elasticSearchPlugin, fieldFilterPlugin, filterResponseData, getFieldsForUser, getImmutableFields, getMongooseProjection, getNextSequence, getSystemManagedFields, immutableField, isFieldUpdateAllowed, methodRegistryPlugin, mongoOperationsPlugin, multiTenantPlugin, observabilityPlugin, parseDuplicateKeyError, prefixedId, requireField, sequentialId, softDeletePlugin, subdocumentPlugin, timestampPlugin, uniqueField, validateUpdateBody, validationChainPlugin };
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import { a as warn, n as parseDuplicateKeyError, r as configureLogger, t as createError } from "./error-Bpbi_NKo.mjs";
2
- import { _ as LookupBuilder } from "./update-DXwVh6M1.mjs";
2
+ import { _ as LookupBuilder } from "./update-DGKMmBgG.mjs";
3
3
  import { t as actions_exports } from "./actions/index.mjs";
4
- import { t as PaginationEngine } from "./PaginationEngine-PLyDhrO7.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-Ow6EUIoo.mjs";
6
- import { i as getMongooseProjection, n as filterResponseData, r as getFieldsForUser, t as createFieldPreset } from "./field-selection-CalOB7yM.mjs";
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-OmdmnHtx.mjs";
4
+ import { t as PaginationEngine } from "./PaginationEngine-nY04eGUM.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-Cp5X5IZu.mjs";
6
+ import { i as getMongooseProjection, n as filterResponseData, r as getFieldsForUser, t as createFieldPreset } from "./field-selection-reyDRzXf.mjs";
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";
9
9
  //#region src/query/QueryParser.ts
10
10
  /**
@@ -413,7 +413,14 @@ var QueryParser = class {
413
413
  */
414
414
  _parsePopulate(populate) {
415
415
  if (!populate) return {};
416
- if (typeof populate === "string") return { simplePopulate: populate };
416
+ if (typeof populate === "string") {
417
+ const paths = populate.split(",").map((p) => p.trim()).filter(Boolean);
418
+ if (paths.length > 0) return {
419
+ simplePopulate: populate,
420
+ populateOptions: paths.map((path) => ({ path }))
421
+ };
422
+ return {};
423
+ }
417
424
  if (typeof populate === "object" && populate !== null) {
418
425
  const populateObj = populate;
419
426
  if (Object.keys(populateObj).length === 0) return {};
@@ -1,4 +1,4 @@
1
- import { $ as SchemaBuilderOptions, T as HttpError, dt as UserContext, m as CrudSchemas, o as CacheAdapter, pt as ValidationResult, x as FieldPreset } from "./types-BlCwDszq.mjs";
1
+ import { E as HttpError, S as FieldPreset, et as SchemaBuilderOptions, ft as UserContext, h as CrudSchemas, mt as ValidationResult, o as CacheAdapter } from "./types-COINbsdL.mjs";
2
2
  import mongoose, { Schema } from "mongoose";
3
3
 
4
4
  //#region src/utils/error.d.ts
@@ -1,4 +1,4 @@
1
- import { A as KeysetPaginationOptions, I as OffsetPaginationOptions, L as OffsetPaginationResult, i as AnyDocument, j as KeysetPaginationResult, n as AggregatePaginationResult, t as AggregatePaginationOptions, z as PaginationConfig } from "../types-BlCwDszq.mjs";
1
+ import { B as PaginationConfig, L as OffsetPaginationOptions, M as KeysetPaginationResult, R as OffsetPaginationResult, i as AnyDocument, j as KeysetPaginationOptions, n as AggregatePaginationResult, t as AggregatePaginationOptions } from "../types-COINbsdL.mjs";
2
2
  import { Model } from "mongoose";
3
3
 
4
4
  //#region src/pagination/PaginationEngine.d.ts
@@ -1,2 +1,2 @@
1
- import { t as PaginationEngine } from "../PaginationEngine-PLyDhrO7.mjs";
1
+ import { t as PaginationEngine } from "../PaginationEngine-nY04eGUM.mjs";
2
2
  export { PaginationEngine };
@@ -1,2 +1,2 @@
1
- import { A as dateSequentialId, B as AuditEntry, C as elasticSearchPlugin, D as PrefixedIdOptions, E as IdGenerator, F as CacheMethods, G as AuditTrailOptions, H as AuditQueryOptions, I as cachePlugin, J as auditLogPlugin, K as AuditTrailQuery, L as BatchOperationsMethods, M as prefixedId, N as sequentialId, O as SequentialIdOptions, P as cascadePlugin, S as ElasticSearchOptions, T as DateSequentialIdOptions, U as AuditQueryResult, V as AuditOperation, W as AuditTrailMethods, X as aggregateHelpersPlugin, Y as AggregateHelpersMethods, _ as MongoOperationsMethods, a as uniqueField, b as methodRegistryPlugin, c as SubdocumentMethods, d as softDeletePlugin, f as ObservabilityOptions, g as multiTenantPlugin, h as MultiTenantOptions, i as requireField, j as getNextSequence, k as customIdPlugin, l as subdocumentPlugin, m as observabilityPlugin, n as blockIf, o as validationChainPlugin, p as OperationMetric, q as auditTrailPlugin, r as immutableField, s as timestampPlugin, t as autoInject, u as SoftDeleteMethods, v as mongoOperationsPlugin, w as CustomIdOptions, x as fieldFilterPlugin, y as MethodRegistryRepository, z as batchOperationsPlugin } from "../validation-chain.plugin-DxqiHv-E.mjs";
1
+ import { A as dateSequentialId, B as AuditEntry, C as elasticSearchPlugin, D as PrefixedIdOptions, E as IdGenerator, F as CacheMethods, G as AuditTrailOptions, H as AuditQueryOptions, I as cachePlugin, J as auditLogPlugin, K as AuditTrailQuery, L as BatchOperationsMethods, M as prefixedId, N as sequentialId, O as SequentialIdOptions, P as cascadePlugin, S as ElasticSearchOptions, T as DateSequentialIdOptions, U as AuditQueryResult, V as AuditOperation, W as AuditTrailMethods, X as aggregateHelpersPlugin, Y as AggregateHelpersMethods, _ as MongoOperationsMethods, a as uniqueField, b as methodRegistryPlugin, c as SubdocumentMethods, d as softDeletePlugin, f as ObservabilityOptions, g as multiTenantPlugin, h as MultiTenantOptions, i as requireField, j as getNextSequence, k as customIdPlugin, l as subdocumentPlugin, m as observabilityPlugin, n as blockIf, o as validationChainPlugin, p as OperationMetric, q as auditTrailPlugin, r as immutableField, s as timestampPlugin, t as autoInject, u as SoftDeleteMethods, v as mongoOperationsPlugin, w as CustomIdOptions, x as fieldFilterPlugin, y as MethodRegistryRepository, z as batchOperationsPlugin } from "../validation-chain.plugin-BNoaKDOm.mjs";
2
2
  export { type AggregateHelpersMethods, type AuditEntry, type AuditOperation, type AuditQueryOptions, type AuditQueryResult, type AuditTrailMethods, type AuditTrailOptions, AuditTrailQuery, type BatchOperationsMethods, type CacheMethods, type CustomIdOptions, type DateSequentialIdOptions, type ElasticSearchOptions, type IdGenerator, type MethodRegistryRepository, type MongoOperationsMethods, type MultiTenantOptions, type ObservabilityOptions, type OperationMetric, type PrefixedIdOptions, type SequentialIdOptions, type SoftDeleteMethods, type SubdocumentMethods, 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 };
@@ -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-Ow6EUIoo.mjs";
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-Cp5X5IZu.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 };
@@ -0,0 +1,57 @@
1
+ import { t as __exportAll } from "./chunk-CfYAbeIz.mjs";
2
+ //#region src/pagination/utils/sort.ts
3
+ var sort_exports = /* @__PURE__ */ __exportAll({
4
+ getPrimaryField: () => getPrimaryField,
5
+ normalizeSort: () => normalizeSort,
6
+ validateKeysetSort: () => validateKeysetSort
7
+ });
8
+ /**
9
+ * Normalizes sort object to ensure stable key order
10
+ * Primary fields first, _id last (not alphabetical)
11
+ *
12
+ * @param sort - Sort specification
13
+ * @returns Normalized sort with stable key order
14
+ */
15
+ function normalizeSort(sort) {
16
+ const normalized = {};
17
+ Object.keys(sort).forEach((key) => {
18
+ if (key !== "_id") normalized[key] = sort[key];
19
+ });
20
+ if (sort._id !== void 0) normalized._id = sort._id;
21
+ return normalized;
22
+ }
23
+ /**
24
+ * Validates and normalizes sort for keyset pagination
25
+ * Auto-adds _id tie-breaker if needed
26
+ * Ensures _id direction matches primary field
27
+ *
28
+ * @param sort - Sort specification
29
+ * @returns Validated and normalized sort
30
+ * @throws Error if sort is invalid for keyset pagination
31
+ */
32
+ function validateKeysetSort(sort) {
33
+ const keys = Object.keys(sort);
34
+ if (keys.length === 0) throw new Error("Keyset pagination requires at least one sort field");
35
+ if (keys.length === 1 && keys[0] === "_id") return normalizeSort(sort);
36
+ for (const key of keys) if (sort[key] !== 1 && sort[key] !== -1) throw new Error(`Invalid sort direction for "${key}": must be 1 or -1, got ${sort[key]}`);
37
+ const nonIdKeys = keys.filter((k) => k !== "_id");
38
+ const primaryDirection = sort[nonIdKeys[0]];
39
+ for (const key of nonIdKeys) if (sort[key] !== primaryDirection) throw new Error("All sort fields must share the same direction for keyset pagination");
40
+ if (keys.includes("_id") && sort._id !== primaryDirection) throw new Error("_id direction must match primary field direction");
41
+ if (!keys.includes("_id")) return normalizeSort({
42
+ ...sort,
43
+ _id: primaryDirection
44
+ });
45
+ return normalizeSort(sort);
46
+ }
47
+ /**
48
+ * Extracts primary sort field (first non-_id field)
49
+ *
50
+ * @param sort - Sort specification
51
+ * @returns Primary field name
52
+ */
53
+ function getPrimaryField(sort) {
54
+ return Object.keys(sort).find((k) => k !== "_id") || "_id";
55
+ }
56
+ //#endregion
57
+ export { sort_exports as n, validateKeysetSort as r, getPrimaryField as t };
@@ -78,6 +78,11 @@ declare class LookupBuilder {
78
78
  * Allows referencing local document fields in the pipeline
79
79
  */
80
80
  let(variables: Record<string, string>): this;
81
+ /**
82
+ * Control pipeline sanitization (default: true)
83
+ * Set to false for auto-generated pipelines that are known safe
84
+ */
85
+ sanitize(enabled: boolean): this;
81
86
  /**
82
87
  * Build the $lookup aggregation stage(s)
83
88
  * Returns an array of pipeline stages including $lookup and optional $unwind
@@ -540,6 +545,17 @@ interface PaginationConfig {
540
545
  /** Use estimatedDocumentCount for faster counts on large collections */
541
546
  useEstimatedCount?: boolean;
542
547
  }
548
+ /** MongoDB collation options for locale-aware string comparison */
549
+ interface CollationOptions {
550
+ locale: string;
551
+ caseLevel?: boolean;
552
+ caseFirst?: 'upper' | 'lower' | 'off';
553
+ strength?: 1 | 2 | 3 | 4 | 5;
554
+ numericOrdering?: boolean;
555
+ alternate?: 'non-ignorable' | 'shifted';
556
+ maxVariable?: 'punct' | 'space';
557
+ backwards?: boolean;
558
+ }
543
559
  /** Base pagination options */
544
560
  interface BasePaginationOptions {
545
561
  /** Pagination mode (explicit override) */
@@ -564,6 +580,8 @@ interface BasePaginationOptions {
564
580
  maxTimeMS?: number;
565
581
  /** Read preference for replica sets (e.g. 'secondaryPreferred') */
566
582
  readPreference?: ReadPreferenceType;
583
+ /** Collation for locale-aware string comparison and case-insensitive sorting */
584
+ collation?: CollationOptions;
567
585
  }
568
586
  /** Offset pagination options */
569
587
  interface OffsetPaginationOptions extends BasePaginationOptions {
@@ -593,7 +611,9 @@ interface AggregatePaginationOptions {
593
611
  hint?: string | Record<string, 1 | -1>;
594
612
  /** Maximum execution time in milliseconds */
595
613
  maxTimeMS?: number;
596
- /** Count strategy (default: 'exact' via $facet) */
614
+ /** Count strategy (default: 'exact' via $facet).
615
+ * 'estimated' is accepted but treated as 'exact' in aggregation context
616
+ * since estimatedDocumentCount is not available inside pipelines. */
597
617
  countStrategy?: 'exact' | 'estimated' | 'none';
598
618
  /** Pagination mode (reserved for API consistency) */
599
619
  mode?: 'offset';
@@ -833,8 +853,14 @@ interface RepositoryInstance {
833
853
  removeAllListeners(event?: string): this;
834
854
  emit(event: string, data: unknown): void;
835
855
  emitAsync(event: string, data: unknown): Promise<void>;
836
- registerMethod?(name: string, fn: Function): void;
856
+ registerMethod?(name: string, fn: (...args: any[]) => any): void;
837
857
  hasMethod?(name: string): boolean;
858
+ _buildContext(operation: string, options: Record<string, unknown>): Promise<RepositoryContext>;
859
+ _handleError(error: Error): HttpError;
860
+ update(id: string | ObjectId, data: Record<string, unknown>, options?: Record<string, unknown>): Promise<unknown>;
861
+ aggregate(pipeline: PipelineStage[], options?: Record<string, unknown>): Promise<unknown[]>;
862
+ getByQuery(query: Record<string, unknown>, options?: Record<string, unknown>): Promise<unknown>;
863
+ _executeQuery<T>(buildQuery: (Model: Model<any>) => Promise<T>): Promise<T>;
838
864
  [key: string]: unknown;
839
865
  }
840
866
  /** Repository operation names */
@@ -942,7 +968,7 @@ interface CrudSchemas {
942
968
  }
943
969
  /** Decoded cursor */
944
970
  interface DecodedCursor {
945
- /** Primary sort field value (rehydrated) */
971
+ /** Primary sort field value (rehydrated) — legacy compat */
946
972
  value: unknown;
947
973
  /** Document ID (rehydrated) */
948
974
  id: ObjectId | string;
@@ -950,6 +976,8 @@ interface DecodedCursor {
950
976
  sort: SortSpec;
951
977
  /** Cursor version */
952
978
  version: number;
979
+ /** All sort field values (rehydrated) — for compound sort */
980
+ values?: Record<string, unknown>;
953
981
  }
954
982
  /** Validator definition */
955
983
  interface ValidatorDefinition {
@@ -1266,4 +1294,4 @@ type AllPluginMethods<TDoc> = {
1266
1294
  */
1267
1295
  type WithPlugins<TDoc, TRepo extends RepositoryInstance = RepositoryInstance> = TRepo & AllPluginMethods<TDoc>;
1268
1296
  //#endregion
1269
- export { SchemaBuilderOptions as $, KeysetPaginationOptions as A, PaginationResult as B, GroupResult as C, InferRawDoc as D, InferDocument as E, ObjectId as F, PopulateSpec as G, Plugin as H, OffsetPaginationOptions as I, RepositoryEvent as J, ReadPreferenceType as K, OffsetPaginationResult as L, Logger as M, MinMaxResult as N, JsonSchema as O, NonNullableFields as P, RequiredBy as Q, OperationOptions as R, FieldRules as S, LookupOptions as St, HttpError as T, PluginFunction as U, PartialBy as V, PluginType as W, RepositoryOperation as X, RepositoryInstance as Y, RepositoryOptions as Z, DeleteResult as _, IController as _t, AnyModel as a, SortSpec as at, EventPhase as b, IResponseFormatter as bt, CacheOptions as c, UpdateManyResult as ct, CascadeRelation as d, UserContext as dt, SelectSpec as et, CreateInput as f, ValidationChainOptions as ft, DeepPartial as g, WithTransactionOptions as gt, DecodedCursor as h, WithPlugins as ht, AnyDocument as i, SortDirection as it, KeysetPaginationResult as j, KeysOfType as k, CacheStats as l, UpdateOptions as lt, CrudSchemas as m, ValidatorDefinition as mt, AggregatePaginationResult as n, SoftDeleteOptions as nt, CacheAdapter as o, Strict as ot, CreateOptions as p, ValidationResult as pt, RepositoryContext as q, AllPluginMethods as r, SoftDeleteRepository as rt, CacheOperationOptions as s, UpdateInput as st, AggregatePaginationOptions as t, SoftDeleteFilterMode as tt, CascadeOptions as u, UpdateWithValidationResult as ut, EventHandlers as v, IControllerResponse as vt, HookMode as w, FieldPreset as x, LookupBuilder as xt, EventPayload as y, IRequestContext as yt, PaginationConfig as z };
1297
+ export { RequiredBy as $, KeysOfType as A, PaginationConfig as B, FieldRules as C, LookupOptions as Ct, InferDocument as D, HttpError as E, NonNullableFields as F, PluginType as G, PartialBy as H, ObjectId as I, RepositoryContext as J, PopulateSpec as K, OffsetPaginationOptions as L, KeysetPaginationResult as M, Logger as N, InferRawDoc as O, MinMaxResult as P, RepositoryOptions as Q, OffsetPaginationResult as R, FieldPreset as S, LookupBuilder as St, HookMode as T, Plugin as U, PaginationResult as V, PluginFunction as W, RepositoryInstance as X, RepositoryEvent as Y, RepositoryOperation as Z, DeepPartial as _, WithTransactionOptions as _t, AnyModel as a, SortDirection as at, EventPayload as b, IRequestContext as bt, CacheOptions as c, UpdateInput as ct, CascadeRelation as d, UpdateWithValidationResult as dt, SchemaBuilderOptions as et, CollationOptions as f, UserContext as ft, DecodedCursor as g, WithPlugins as gt, CrudSchemas as h, ValidatorDefinition as ht, AnyDocument as i, SoftDeleteRepository as it, KeysetPaginationOptions as j, JsonSchema as k, CacheStats as l, UpdateManyResult as lt, CreateOptions as m, ValidationResult as mt, AggregatePaginationResult as n, SoftDeleteFilterMode as nt, CacheAdapter as o, SortSpec as ot, CreateInput as p, ValidationChainOptions as pt, ReadPreferenceType as q, AllPluginMethods as r, SoftDeleteOptions as rt, CacheOperationOptions as s, Strict as st, AggregatePaginationOptions as t, SelectSpec as tt, CascadeOptions as u, UpdateOptions as ut, DeleteResult as v, IController as vt, GroupResult as w, EventPhase as x, IResponseFormatter as xt, EventHandlers as y, IControllerResponse as yt, OperationOptions as z };
@@ -10,12 +10,14 @@ const BLOCKED_PIPELINE_STAGES = [
10
10
  "$currentOp",
11
11
  "$listSessions"
12
12
  ];
13
- /** Operators that can enable arbitrary code execution */
13
+ /** Operators that can enable arbitrary code execution.
14
+ * Note: $expr is intentionally NOT blocked — it's needed for pipeline-form
15
+ * $lookup correlations (let + $match.$expr) and is a comparison operator,
16
+ * not a code execution vector like $where/$function/$accumulator. */
14
17
  const DANGEROUS_OPERATORS = [
15
18
  "$where",
16
19
  "$function",
17
- "$accumulator",
18
- "$expr"
20
+ "$accumulator"
19
21
  ];
20
22
  /**
21
23
  * Fluent builder for MongoDB $lookup aggregation stage
@@ -91,6 +93,14 @@ var LookupBuilder = class LookupBuilder {
91
93
  return this;
92
94
  }
93
95
  /**
96
+ * Control pipeline sanitization (default: true)
97
+ * Set to false for auto-generated pipelines that are known safe
98
+ */
99
+ sanitize(enabled) {
100
+ this.options.sanitize = enabled;
101
+ return this;
102
+ }
103
+ /**
94
104
  * Build the $lookup aggregation stage(s)
95
105
  * Returns an array of pipeline stages including $lookup and optional $unwind
96
106
  *
@@ -122,10 +132,16 @@ var LookupBuilder = class LookupBuilder {
122
132
  } };
123
133
  } else {
124
134
  const safePipeline = this.options.sanitize !== false ? LookupBuilder.sanitizePipeline(pipeline) : pipeline;
135
+ let effectiveLet = letVars;
136
+ let effectivePipeline = safePipeline;
137
+ if (localField && foreignField && !letVars) {
138
+ effectiveLet = { lookupJoinVal: `$${localField}` };
139
+ effectivePipeline = [{ $match: { $expr: { $eq: [`$${foreignField}`, "$$lookupJoinVal"] } } }, ...safePipeline];
140
+ }
125
141
  lookupStage = { $lookup: {
126
142
  from,
127
- ...letVars && { let: letVars },
128
- pipeline: safePipeline,
143
+ ...effectiveLet && { let: effectiveLet },
144
+ pipeline: effectivePipeline,
129
145
  as: outputField
130
146
  } };
131
147
  }
@@ -181,11 +197,22 @@ var LookupBuilder = class LookupBuilder {
181
197
  for (const field of lookup.select.split(",").map((f) => f.trim())) if (field.startsWith("-")) projection[field.substring(1)] = 0;
182
198
  else projection[field] = 1;
183
199
  } else projection = lookup.select;
184
- const selectPipeline = [{ $project: projection }];
200
+ const joinStage = { $match: { $expr: { $eq: [`$${lookup.foreignField}`, "$$lookupJoinVal"] } } };
185
201
  const existing = lookup.pipeline || [];
186
- builder.pipeline([...existing, ...selectPipeline]);
187
- } else if (lookup.pipeline) builder.pipeline(lookup.pipeline);
188
- if (lookup.let) builder.let(lookup.let);
202
+ builder.pipeline([
203
+ joinStage,
204
+ ...existing,
205
+ { $project: projection }
206
+ ]);
207
+ builder.let({
208
+ lookupJoinVal: `$${lookup.localField}`,
209
+ ...lookup.let || {}
210
+ });
211
+ builder.sanitize(false);
212
+ } else if (lookup.pipeline) {
213
+ builder.pipeline(lookup.pipeline);
214
+ if (lookup.let) builder.let(lookup.let);
215
+ } else if (lookup.let) builder.let(lookup.let);
189
216
  return builder.build();
190
217
  });
191
218
  }
@@ -341,32 +368,12 @@ async function lookup(Model, lookupOptions) {
341
368
  const { from, localField, foreignField, as, pipeline = [], let: letVars, query = {}, options = {} } = lookupOptions;
342
369
  const aggPipeline = [];
343
370
  if (Object.keys(query).length > 0) aggPipeline.push({ $match: query });
344
- if (pipeline.length > 0 || letVars) if (pipeline.length === 0 && localField && foreignField) {
345
- const autoPipeline = [{ $match: { $expr: { $eq: [`$${foreignField}`, `$$${localField}`] } } }];
346
- aggPipeline.push({ $lookup: {
347
- from,
348
- let: {
349
- [localField]: `$${localField}`,
350
- ...letVars || {}
351
- },
352
- pipeline: autoPipeline,
353
- as
354
- } });
355
- } else {
356
- const safePipeline = lookupOptions.sanitize !== false ? LookupBuilder.sanitizePipeline(pipeline) : pipeline;
357
- aggPipeline.push({ $lookup: {
358
- from,
359
- ...letVars && { let: letVars },
360
- pipeline: safePipeline,
361
- as
362
- } });
363
- }
364
- else aggPipeline.push({ $lookup: {
365
- from,
366
- localField,
367
- foreignField,
368
- as
369
- } });
371
+ const builder = new LookupBuilder(from).localField(localField).foreignField(foreignField).as(as || from);
372
+ if (lookupOptions.single) builder.single(lookupOptions.single);
373
+ if (pipeline.length > 0) builder.pipeline(pipeline);
374
+ if (letVars) builder.let(letVars);
375
+ if (lookupOptions.sanitize === false) builder.sanitize(false);
376
+ aggPipeline.push(...builder.build());
370
377
  return aggregate(Model, aggPipeline, options);
371
378
  }
372
379
  /**
@@ -1,5 +1,5 @@
1
- import { G as PopulateSpec, at as SortSpec, et as SelectSpec } from "../types-BlCwDszq.mjs";
2
- import { a as isFieldUpdateAllowed, c as configureLogger, d as getFieldsForUser, f as getMongooseProjection, i as getSystemManagedFields, l as createFieldPreset, n as buildCrudSchemasFromMongooseSchema, o as validateUpdateBody, p as createError, r as getImmutableFields, s as createMemoryCache, t as buildCrudSchemasFromModel, u as filterResponseData } from "../mongooseToJsonSchema-BqgVOlrR.mjs";
1
+ import { K as PopulateSpec, ot as SortSpec, tt as SelectSpec } from "../types-COINbsdL.mjs";
2
+ import { a as isFieldUpdateAllowed, c as configureLogger, d as getFieldsForUser, f as getMongooseProjection, i as getSystemManagedFields, l as createFieldPreset, n as buildCrudSchemasFromMongooseSchema, o as validateUpdateBody, p as createError, r as getImmutableFields, s as createMemoryCache, t as buildCrudSchemasFromModel, u as filterResponseData } from "../mongooseToJsonSchema-RX9YfJLu.mjs";
3
3
 
4
4
  //#region src/utils/cache-keys.d.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
1
  import { r as configureLogger, t as createError } from "../error-Bpbi_NKo.mjs";
2
- import { a as byIdKey, c as listQueryKey, i as getMongooseProjection, l as modelPattern, n as filterResponseData, o as byQueryKey, r as getFieldsForUser, s as listPattern, t as createFieldPreset, u as versionKey } from "../field-selection-CalOB7yM.mjs";
3
- import { a as isFieldUpdateAllowed, i as getSystemManagedFields, n as buildCrudSchemasFromMongooseSchema, o as validateUpdateBody, r as getImmutableFields, s as createMemoryCache, t as buildCrudSchemasFromModel } from "../mongooseToJsonSchema-OmdmnHtx.mjs";
2
+ import { a as byIdKey, c as listQueryKey, i as getMongooseProjection, l as modelPattern, n as filterResponseData, o as byQueryKey, r as getFieldsForUser, s as listPattern, t as createFieldPreset, u as versionKey } from "../field-selection-reyDRzXf.mjs";
3
+ 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";
4
4
  export { buildCrudSchemasFromModel, buildCrudSchemasFromMongooseSchema, byIdKey, byQueryKey, configureLogger, createError, createFieldPreset, createMemoryCache, filterResponseData, getFieldsForUser, getImmutableFields, getMongooseProjection, getSystemManagedFields, isFieldUpdateAllowed, listPattern, listQueryKey, modelPattern, validateUpdateBody, versionKey };
@@ -1,4 +1,4 @@
1
- import { F as ObjectId, G as PopulateSpec, H as Plugin, L as OffsetPaginationResult, M as Logger, Y as RepositoryInstance, at as SortSpec, c as CacheOptions, et as SelectSpec, ft as ValidationChainOptions, l as CacheStats, mt as ValidatorDefinition, nt as SoftDeleteOptions, q as RepositoryContext, u as CascadeOptions, x as FieldPreset } from "./types-BlCwDszq.mjs";
1
+ import { I as ObjectId, J as RepositoryContext, K as PopulateSpec, N as Logger, R as OffsetPaginationResult, S as FieldPreset, U as Plugin, X as RepositoryInstance, c as CacheOptions, ht as ValidatorDefinition, l as CacheStats, ot as SortSpec, pt as ValidationChainOptions, rt as SoftDeleteOptions, tt as SelectSpec, u as CascadeOptions } from "./types-COINbsdL.mjs";
2
2
  import mongoose, { ClientSession } from "mongoose";
3
3
 
4
4
  //#region src/plugins/aggregate-helpers.plugin.d.ts
@@ -586,7 +586,7 @@ declare function fieldFilterPlugin(fieldPreset: FieldPreset): Plugin;
586
586
  * Extended repository interface with method registry
587
587
  */
588
588
  interface MethodRegistryRepository extends RepositoryInstance {
589
- registerMethod(name: string, fn: Function): void;
589
+ registerMethod(name: string, fn: (...args: any[]) => any): void;
590
590
  hasMethod(name: string): boolean;
591
591
  getRegisteredMethods(): string[];
592
592
  }