@classytic/mongokit 3.6.3 → 3.6.4

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,2 +1,2 @@
1
- import { a as create_d_exports, i as delete_d_exports, n as update_d_exports, o as aggregate_d_exports, r as read_d_exports } from "../index-BSRSsRRx.mjs";
1
+ import { a as create_d_exports, i as delete_d_exports, n as update_d_exports, o as aggregate_d_exports, r as read_d_exports } from "../index-jzO5hMtF.mjs";
2
2
  export { aggregate_d_exports as aggregate, create_d_exports as create, delete_d_exports as deleteActions, read_d_exports as read, update_d_exports as update };
@@ -1,4 +1,4 @@
1
- import { J as Plugin } from "../types-DiQfDesD.mjs";
1
+ import { J as Plugin } from "../types-BoH1qdHo.mjs";
2
2
  import { ClientSession, PipelineStage } from "mongoose";
3
3
 
4
4
  //#region src/ai/types.d.ts
@@ -1,4 +1,4 @@
1
- import { $ as ReadPreferenceType, At as LookupOptions, D as GroupResult, V as ObjectId, W as OperationOptions, Z as PopulateSpec, _t as UpdateOptions, a as AnyDocument, b as DeleteResult, g as CreateOptions, gt as UpdateManyResult, pt as SortSpec, st as SelectSpec, vt as UpdateWithValidationResult, z as MinMaxResult } from "./types-DiQfDesD.mjs";
1
+ import { $ as ReadPreferenceType, At as LookupOptions, D as GroupResult, V as ObjectId, W as OperationOptions, Z as PopulateSpec, _t as UpdateOptions, a as AnyDocument, b as DeleteResult, g as CreateOptions, gt as UpdateManyResult, pt as SortSpec, st as SelectSpec, vt as UpdateWithValidationResult, z as MinMaxResult } from "./types-BoH1qdHo.mjs";
2
2
  import { ClientSession, Model, PipelineStage } from "mongoose";
3
3
 
4
4
  //#region src/actions/aggregate.d.ts
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
- import { $ as ReadPreferenceType, A as InferDocument, At as LookupOptions, B as NonNullableFields, C as EventPayload, Ct as WithPlugins, D as GroupResult, Dt as IRequestContext, E as FieldRules, Et as IControllerResponse, F as KeysetPaginationResult, G as PaginationConfig, H as OffsetPaginationOptions, I as Logger, J as Plugin, K as PaginationResult, L as LookupPopulateOptions, M as JsonSchema, N as KeysOfType, O as HookMode, Ot as IResponseFormatter, P as KeysetPaginationOptions, Q as ReadOptions, R as LookupPopulateResult, S as EventHandlers, St as ValidatorDefinition, T as FieldPreset, Tt as IController, U as OffsetPaginationResult, V as ObjectId, W as OperationOptions, X as PluginType, Y as PluginFunction, Z as PopulateSpec, _ as CrudSchemas, _t as UpdateOptions, a as AnyDocument, at as RequiredBy, b as DeleteResult, bt as ValidationChainOptions, c as CacheOperationOptions, ct as SessionOptions, d as CacheableOptions, dt as SoftDeleteRepository, et as RepositoryContext, f as CascadeOptions, ft as SortDirection, g as CreateOptions, gt as UpdateManyResult, h as CreateInput, ht as UpdateInput, i as AllPluginMethods, it as RepositoryOptions, j as InferRawDoc, k as HttpError, kt as LookupBuilder, l as CacheOptions, lt as SoftDeleteFilterMode, m as CollationOptions, mt as Strict, n as AggregatePaginationOptions, nt as RepositoryInstance, o as AnyModel, ot as SchemaBuilderOptions, p as CascadeRelation, pt as SortSpec, q as PartialBy, r as AggregatePaginationResult, rt as RepositoryOperation, s as CacheAdapter, st as SelectSpec, t as AggregateOptions, tt as RepositoryEvent, u as CacheStats, ut as SoftDeleteOptions, v as DecodedCursor, vt as UpdateWithValidationResult, w as EventPhase, wt as WithTransactionOptions, x as DocField, xt as ValidationResult, y as DeepPartial, yt as UserContext, z as MinMaxResult } from "./types-DiQfDesD.mjs";
2
- import { t as index_d_exports } from "./index-BSRSsRRx.mjs";
1
+ import { $ as ReadPreferenceType, A as InferDocument, At as LookupOptions, B as NonNullableFields, C as EventPayload, Ct as WithPlugins, D as GroupResult, Dt as IRequestContext, E as FieldRules, Et as IControllerResponse, F as KeysetPaginationResult, G as PaginationConfig, H as OffsetPaginationOptions, I as Logger, J as Plugin, K as PaginationResult, L as LookupPopulateOptions, M as JsonSchema, N as KeysOfType, O as HookMode, Ot as IResponseFormatter, P as KeysetPaginationOptions, Q as ReadOptions, R as LookupPopulateResult, S as EventHandlers, St as ValidatorDefinition, T as FieldPreset, Tt as IController, U as OffsetPaginationResult, V as ObjectId, W as OperationOptions, X as PluginType, Y as PluginFunction, Z as PopulateSpec, _ as CrudSchemas, _t as UpdateOptions, a as AnyDocument, at as RequiredBy, b as DeleteResult, bt as ValidationChainOptions, c as CacheOperationOptions, ct as SessionOptions, d as CacheableOptions, dt as SoftDeleteRepository, et as RepositoryContext, f as CascadeOptions, ft as SortDirection, g as CreateOptions, gt as UpdateManyResult, h as CreateInput, ht as UpdateInput, i as AllPluginMethods, it as RepositoryOptions, j as InferRawDoc, k as HttpError, kt as LookupBuilder, l as CacheOptions, lt as SoftDeleteFilterMode, m as CollationOptions, mt as Strict, n as AggregatePaginationOptions, nt as RepositoryInstance, o as AnyModel, ot as SchemaBuilderOptions, p as CascadeRelation, pt as SortSpec, q as PartialBy, r as AggregatePaginationResult, rt as RepositoryOperation, s as CacheAdapter, st as SelectSpec, t as AggregateOptions, tt as RepositoryEvent, u as CacheStats, ut as SoftDeleteOptions, v as DecodedCursor, vt as UpdateWithValidationResult, w as EventPhase, wt as WithTransactionOptions, x as DocField, xt as ValidationResult, y as DeepPartial, yt as UserContext, z as MinMaxResult } from "./types-BoH1qdHo.mjs";
2
+ import { t as index_d_exports } from "./index-jzO5hMtF.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-BsFzKVnO.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-BXx6Ogpp.mjs";
5
5
  import { n as SchemaPathsLike, t as FieldType$1 } from "./coercion-B19MD38s.mjs";
6
6
  import { n as SchemaIndexes } from "./indexes-qIBCZ3mY.mjs";
7
- 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-D2YjHo7W.mjs";
7
+ 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-BvD1NDl9.mjs";
8
8
  import * as _$mongoose from "mongoose";
9
9
  import { ClientSession, Expression, Model, PipelineStage, PopulateOptions } from "mongoose";
10
10
 
package/dist/index.mjs CHANGED
@@ -7,7 +7,7 @@ import { isGeoOperator, parseGeoFilter } from "./query/primitives/geo.mjs";
7
7
  import { i as getMongooseProjection, n as filterResponseData, r as getFieldsForUser, t as createFieldPreset } from "./field-selection-C5o7jyyA.mjs";
8
8
  import { buildFieldTypeMap, coerceFieldValue, coerceHeuristic } from "./query/primitives/coercion.mjs";
9
9
  import { extractSchemaIndexes } from "./query/primitives/indexes.mjs";
10
- import { a as isFieldUpdateAllowed, i as getSystemManagedFields, n as buildCrudSchemasFromMongooseSchema, o as validateUpdateBody, r as getImmutableFields, s as createMemoryCache, t as buildCrudSchemasFromModel } from "./mongooseToJsonSchema-MlaD3C0B.mjs";
10
+ import { a as isFieldUpdateAllowed, i as getSystemManagedFields, n as buildCrudSchemasFromMongooseSchema, o as validateUpdateBody, r as getImmutableFields, s as createMemoryCache, t as buildCrudSchemasFromModel } from "./mongooseToJsonSchema-BlfkI9LC.mjs";
11
11
  //#region src/query/QueryParser.ts
12
12
  /**
13
13
  * Modern Query Parser
@@ -245,10 +245,10 @@ function buildJsonSchemaFromPaths(mongooseSchema, options) {
245
245
  }
246
246
  for (const [rootField, fieldPaths] of rootFields.entries()) if (fieldPaths.length === 1 && fieldPaths[0].path === rootField) {
247
247
  const schemaType = fieldPaths[0].schemaType;
248
- properties[rootField] = schemaTypeToJsonSchema(schemaType);
248
+ properties[rootField] = schemaTypeToJsonSchema(schemaType, options);
249
249
  if (schemaType.isRequired && !isSoftRequired(rootField, schemaType)) required.push(rootField);
250
250
  } else {
251
- const nestedSchema = buildNestedJsonSchema(fieldPaths, rootField);
251
+ const nestedSchema = buildNestedJsonSchema(fieldPaths, rootField, options);
252
252
  properties[rootField] = nestedSchema.schema;
253
253
  if (nestedSchema.required) required.push(rootField);
254
254
  }
@@ -271,14 +271,14 @@ function buildJsonSchemaFromPaths(mongooseSchema, options) {
271
271
  /**
272
272
  * Build nested JSON schema from dot-notation paths
273
273
  */
274
- function buildNestedJsonSchema(fieldPaths, rootField) {
274
+ function buildNestedJsonSchema(fieldPaths, rootField, options = {}) {
275
275
  const properties = {};
276
276
  const required = [];
277
277
  let hasRequiredFields = false;
278
278
  for (const { path, schemaType } of fieldPaths) {
279
279
  const parts = path.substring(rootField.length + 1).split(".");
280
280
  if (parts.length === 1) {
281
- properties[parts[0]] = schemaTypeToJsonSchema(schemaType);
281
+ properties[parts[0]] = schemaTypeToJsonSchema(schemaType, options);
282
282
  if (schemaType.isRequired) {
283
283
  required.push(parts[0]);
284
284
  hasRequiredFields = true;
@@ -292,7 +292,7 @@ function buildNestedJsonSchema(fieldPaths, rootField) {
292
292
  const nestedObj = properties[fieldName];
293
293
  if (!nestedObj.properties) nestedObj.properties = {};
294
294
  const deepPath = parts.slice(1).join(".");
295
- nestedObj.properties[deepPath] = schemaTypeToJsonSchema(schemaType);
295
+ nestedObj.properties[deepPath] = schemaTypeToJsonSchema(schemaType, options);
296
296
  }
297
297
  }
298
298
  const schema = {
@@ -324,10 +324,10 @@ function buildNestedJsonSchema(fieldPaths, rootField) {
324
324
  * `{ type: 'object', additionalProperties: true }` so we never block a
325
325
  * valid payload with the old `{ type: 'string' }` default.
326
326
  */
327
- function introspectArrayItems(schemaType) {
328
- if (hasInnerSchema(schemaType)) return subSchemaToJsonSchema(schemaType.schema);
327
+ function introspectArrayItems(schemaType, options = {}) {
328
+ if (hasInnerSchema(schemaType)) return subSchemaToJsonSchema(schemaType.schema, options);
329
329
  const caster = schemaType?.caster;
330
- if (caster && typeof caster === "object" && "instance" in caster && caster.instance) return schemaTypeToJsonSchema(caster);
330
+ if (caster && typeof caster === "object" && "instance" in caster && caster.instance) return schemaTypeToJsonSchema(caster, options);
331
331
  const declaredType = schemaType?.options?.type;
332
332
  if (Array.isArray(declaredType) && declaredType.length > 0) {
333
333
  const inner = declaredType[0];
@@ -335,7 +335,7 @@ function introspectArrayItems(schemaType) {
335
335
  type: "object",
336
336
  additionalProperties: true
337
337
  };
338
- return jsonTypeFor(inner, {}, /* @__PURE__ */ new WeakSet());
338
+ return jsonTypeFor(inner, options, /* @__PURE__ */ new WeakSet());
339
339
  }
340
340
  return {
341
341
  type: "object",
@@ -348,7 +348,7 @@ function introspectArrayItems(schemaType) {
348
348
  * does NOT apply create/update field rules — subdocument shape should faithfully
349
349
  * reflect the declared schema, not the top-level CRUD-mode omissions.
350
350
  */
351
- function subSchemaToJsonSchema(subSchema) {
351
+ function subSchemaToJsonSchema(subSchema, options = {}) {
352
352
  const properties = {};
353
353
  const required = [];
354
354
  const paths = subSchema.paths ?? {};
@@ -358,7 +358,7 @@ function subSchemaToJsonSchema(subSchema) {
358
358
  const instance = st.instance;
359
359
  if (!instance || isObjectIdInstance(instance)) continue;
360
360
  }
361
- properties[path] = schemaTypeToJsonSchema(st);
361
+ properties[path] = schemaTypeToJsonSchema(st, options);
362
362
  if (st.isRequired) required.push(path);
363
363
  }
364
364
  const result = {
@@ -371,7 +371,7 @@ function subSchemaToJsonSchema(subSchema) {
371
371
  /**
372
372
  * Convert Mongoose SchemaType to JSON Schema
373
373
  */
374
- function schemaTypeToJsonSchema(schemaType) {
374
+ function schemaTypeToJsonSchema(schemaType, builderOptions = {}) {
375
375
  if (typeof schemaType?.jsonSchema === "function") try {
376
376
  const custom = schemaType.jsonSchema();
377
377
  if (custom && typeof custom === "object") return custom;
@@ -400,16 +400,16 @@ function schemaTypeToJsonSchema(schemaType) {
400
400
  } else if (isObjectIdInstance(instance)) {
401
401
  result.type = "string";
402
402
  result.pattern = "^[0-9a-fA-F]{24}$";
403
- if (typeof options.ref === "string" && options.ref.length > 0) result["x-ref"] = options.ref;
403
+ if (builderOptions.openApiExtensions === true && typeof options.ref === "string" && options.ref.length > 0) result["x-ref"] = options.ref;
404
404
  } else if (instance === "Array") {
405
405
  result.type = "array";
406
- result.items = introspectArrayItems(schemaType);
406
+ result.items = introspectArrayItems(schemaType, builderOptions);
407
407
  } else if (instance === "Map") {
408
408
  result.type = "object";
409
409
  const ofDef = options.of;
410
410
  if (ofDef !== void 0 && ofDef !== null) result.additionalProperties = jsonTypeFor(ofDef, {}, /* @__PURE__ */ new WeakSet());
411
411
  else result.additionalProperties = true;
412
- } else if (hasInnerSchema(schemaType)) return subSchemaToJsonSchema(schemaType.schema);
412
+ } else if (hasInnerSchema(schemaType)) return subSchemaToJsonSchema(schemaType.schema, builderOptions);
413
413
  else {
414
414
  result.type = "object";
415
415
  result.additionalProperties = true;
@@ -511,10 +511,14 @@ function jsonTypeFor(def, options, seen) {
511
511
  additionalProperties: true
512
512
  };
513
513
  }
514
- if (isObjectIdType(typedDef.type)) return {
515
- type: "string",
516
- pattern: "^[0-9a-fA-F]{24}$"
517
- };
514
+ if (isObjectIdType(typedDef.type)) {
515
+ const objIdResult = {
516
+ type: "string",
517
+ pattern: "^[0-9a-fA-F]{24}$"
518
+ };
519
+ if (options?.openApiExtensions === true && typeof typedDef.ref === "string" && typedDef.ref.length > 0) objIdResult["x-ref"] = typedDef.ref;
520
+ return objIdResult;
521
+ }
518
522
  if (isMongooseSchema(typedDef.type)) {
519
523
  const obj = typedDef.type.obj;
520
524
  if (obj && typeof obj === "object") {
@@ -547,7 +551,7 @@ function jsonTypeFor(def, options, seen) {
547
551
  additionalProperties: true
548
552
  };
549
553
  seen.add(def);
550
- return subSchemaToJsonSchema(def);
554
+ return subSchemaToJsonSchema(def, options);
551
555
  }
552
556
  if (isPlainObject(def)) {
553
557
  if (seen.has(def)) return {
@@ -1,4 +1,4 @@
1
- import { T as FieldPreset, _ as CrudSchemas, k as HttpError, ot as SchemaBuilderOptions, s as CacheAdapter, xt as ValidationResult, yt as UserContext } from "./types-DiQfDesD.mjs";
1
+ import { T as FieldPreset, _ as CrudSchemas, k as HttpError, ot as SchemaBuilderOptions, s as CacheAdapter, xt as ValidationResult, yt as UserContext } from "./types-BoH1qdHo.mjs";
2
2
  import mongoose, { Schema } from "mongoose";
3
3
 
4
4
  //#region src/utils/error.d.ts
@@ -1,4 +1,4 @@
1
- import { F as KeysetPaginationResult, G as PaginationConfig, H as OffsetPaginationOptions, P as KeysetPaginationOptions, U as OffsetPaginationResult, a as AnyDocument, n as AggregatePaginationOptions, r as AggregatePaginationResult } from "../types-DiQfDesD.mjs";
1
+ import { F as KeysetPaginationResult, G as PaginationConfig, H as OffsetPaginationOptions, P as KeysetPaginationOptions, U as OffsetPaginationResult, a as AnyDocument, n as AggregatePaginationOptions, r as AggregatePaginationResult } from "../types-BoH1qdHo.mjs";
2
2
  import { Model } from "mongoose";
3
3
 
4
4
  //#region src/pagination/PaginationEngine.d.ts
@@ -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-BsFzKVnO.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-BXx6Ogpp.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 };
@@ -1079,6 +1079,19 @@ interface SchemaBuilderOptions {
1079
1079
  type: string;
1080
1080
  } | unknown>;
1081
1081
  };
1082
+ /**
1083
+ * Emit OpenAPI vendor extensions (`x-*` keywords like `x-ref` for populated
1084
+ * ObjectId fields). Default: `false`.
1085
+ *
1086
+ * Why opt-in: Ajv's strict mode THROWS on any `x-*` keyword it doesn't
1087
+ * recognize (`strict mode: unknown keyword: "x-ref"`). Consumers validating
1088
+ * request bodies with Ajv strict need a keyword-clean schema; consumers
1089
+ * generating OpenAPI documentation want the vendor extensions. Default is
1090
+ * OFF so Ajv-strict-mode consumers are safe out of the box. Turn ON to
1091
+ * include `x-ref` etc. in the output (typically when feeding the schema
1092
+ * into a docgen tool like @fastify/swagger or redocly).
1093
+ */
1094
+ openApiExtensions?: boolean;
1082
1095
  }
1083
1096
  /** JSON Schema type */
1084
1097
  interface JsonSchema {
@@ -1,5 +1,5 @@
1
- import { Z as PopulateSpec, pt as SortSpec, st as SelectSpec } from "../types-DiQfDesD.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-D2YjHo7W.mjs";
1
+ import { Z as PopulateSpec, pt as SortSpec, st as SelectSpec } from "../types-BoH1qdHo.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-BvD1NDl9.mjs";
3
3
 
4
4
  //#region src/utils/cache-keys.d.ts
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { r as configureLogger, t as createError } from "../error-Bpbi_NKo.mjs";
2
2
  import { n as isObjectIdInstance, r as isValidIdForType, t as getSchemaIdType } from "../id-resolution-LZ-cCwR5.mjs";
3
3
  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-C5o7jyyA.mjs";
4
- import { a as isFieldUpdateAllowed, i as getSystemManagedFields, n as buildCrudSchemasFromMongooseSchema, o as validateUpdateBody, r as getImmutableFields, s as createMemoryCache, t as buildCrudSchemasFromModel } from "../mongooseToJsonSchema-MlaD3C0B.mjs";
4
+ import { a as isFieldUpdateAllowed, i as getSystemManagedFields, n as buildCrudSchemasFromMongooseSchema, o as validateUpdateBody, r as getImmutableFields, s as createMemoryCache, t as buildCrudSchemasFromModel } from "../mongooseToJsonSchema-BlfkI9LC.mjs";
5
5
  export { buildCrudSchemasFromModel, buildCrudSchemasFromMongooseSchema, byIdKey, byQueryKey, configureLogger, createError, createFieldPreset, createMemoryCache, filterResponseData, getFieldsForUser, getImmutableFields, getMongooseProjection, getSchemaIdType, getSystemManagedFields, isFieldUpdateAllowed, isObjectIdInstance, isValidIdForType, listPattern, listQueryKey, modelPattern, validateUpdateBody, versionKey };
@@ -1,4 +1,4 @@
1
- import { I as Logger, J as Plugin, St as ValidatorDefinition, T as FieldPreset, U as OffsetPaginationResult, V as ObjectId, Z as PopulateSpec, bt as ValidationChainOptions, et as RepositoryContext, f as CascadeOptions, l as CacheOptions, nt as RepositoryInstance, pt as SortSpec, st as SelectSpec, u as CacheStats, ut as SoftDeleteOptions } from "./types-DiQfDesD.mjs";
1
+ import { I as Logger, J as Plugin, St as ValidatorDefinition, T as FieldPreset, U as OffsetPaginationResult, V as ObjectId, Z as PopulateSpec, bt as ValidationChainOptions, et as RepositoryContext, f as CascadeOptions, l as CacheOptions, nt as RepositoryInstance, pt as SortSpec, st as SelectSpec, u as CacheStats, ut as SoftDeleteOptions } from "./types-BoH1qdHo.mjs";
2
2
  import mongoose, { ClientSession } from "mongoose";
3
3
 
4
4
  //#region src/plugins/aggregate-helpers.plugin.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classytic/mongokit",
3
- "version": "3.6.3",
3
+ "version": "3.6.4",
4
4
  "description": "Production-grade MongoDB repositories with zero dependencies - smart pagination, events, and plugins",
5
5
  "type": "module",
6
6
  "sideEffects": false,