@classytic/mongokit 3.3.1 → 3.3.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
@@ -945,6 +945,16 @@ declare class QueryParser {
945
945
  properties: Record<string, unknown>;
946
946
  required?: string[];
947
947
  };
948
+ /**
949
+ * Get the query schema with OpenAPI extensions (x-internal metadata).
950
+ * Use this when generating OpenAPI/Swagger docs — it includes a documentary
951
+ * `_filterOperators` property describing available filter operators.
952
+ * For validation-only schemas, use `getQuerySchema()` instead.
953
+ */
954
+ getOpenAPIQuerySchema(): {
955
+ type: "object";
956
+ properties: Record<string, unknown>;
957
+ };
948
958
  /**
949
959
  * Get the JSON Schema type for a filter operator
950
960
  */
package/dist/index.mjs CHANGED
@@ -270,17 +270,28 @@ var QueryParser = class {
270
270
  };
271
271
  }
272
272
  }
273
- properties["_filterOperators"] = {
274
- type: "string",
275
- description: this._buildOperatorDescription(availableOperators),
276
- "x-internal": true
277
- };
278
273
  return {
279
274
  type: "object",
280
275
  properties
281
276
  };
282
277
  }
283
278
  /**
279
+ * Get the query schema with OpenAPI extensions (x-internal metadata).
280
+ * Use this when generating OpenAPI/Swagger docs — it includes a documentary
281
+ * `_filterOperators` property describing available filter operators.
282
+ * For validation-only schemas, use `getQuerySchema()` instead.
283
+ */
284
+ getOpenAPIQuerySchema() {
285
+ const schema = this.getQuerySchema();
286
+ const availableOperators = this.options.allowedOperators ? Object.entries(this.operators).filter(([key]) => this.options.allowedOperators.includes(key)) : Object.entries(this.operators);
287
+ schema.properties["_filterOperators"] = {
288
+ type: "string",
289
+ description: this._buildOperatorDescription(availableOperators),
290
+ "x-internal": true
291
+ };
292
+ return schema;
293
+ }
294
+ /**
284
295
  * Get the JSON Schema type for a filter operator
285
296
  */
286
297
  _getOperatorSchemaType(op) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classytic/mongokit",
3
- "version": "3.3.1",
3
+ "version": "3.3.2",
4
4
  "description": "Production-grade MongoDB repositories with zero dependencies - smart pagination, events, and plugins",
5
5
  "type": "module",
6
6
  "sideEffects": false,