@mastra/convex 1.9.1-alpha.0 → 1.9.1-alpha.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.
@@ -3,7 +3,7 @@ name: mastra-convex
3
3
  description: Documentation for @mastra/convex. Use when working with @mastra/convex APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/convex"
6
- version: "1.9.1-alpha.0"
6
+ version: "1.9.1-alpha.2"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.9.1-alpha.0",
2
+ "version": "1.9.1-alpha.2",
3
3
  "package": "@mastra/convex",
4
4
  "exports": {
5
5
  "ConvexCacheClient": {
@@ -10,7 +10,7 @@
10
10
  "ConvexNativeVector": {
11
11
  "types": "dist/vector/native.d.ts",
12
12
  "implementation": "dist/index.js",
13
- "line": 2884
13
+ "line": 2875
14
14
  },
15
15
  "ConvexServerCache": {
16
16
  "types": "dist/cache/index.d.ts",
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "mastraCache": {
46
46
  "types": "dist/server/cache.d.ts",
47
- "implementation": "dist/server-BD08ym0I.js",
47
+ "implementation": "dist/server-DS6X9y1L.js",
48
48
  "line": 297
49
49
  },
50
50
  "mastraCacheListItemsTable": {
@@ -79,18 +79,18 @@
79
79
  },
80
80
  "mastraNativeVectorAction": {
81
81
  "types": "dist/server/native-vector.d.ts",
82
- "implementation": "dist/server-BD08ym0I.js",
83
- "line": 2244
82
+ "implementation": "dist/server-DS6X9y1L.js",
83
+ "line": 2257
84
84
  },
85
85
  "mastraNativeVectorMutation": {
86
86
  "types": "dist/server/native-vector.d.ts",
87
- "implementation": "dist/server-BD08ym0I.js",
88
- "line": 2300
87
+ "implementation": "dist/server-DS6X9y1L.js",
88
+ "line": 2313
89
89
  },
90
90
  "mastraNativeVectorQuery": {
91
91
  "types": "dist/server/native-vector.d.ts",
92
- "implementation": "dist/server-BD08ym0I.js",
93
- "line": 2266
92
+ "implementation": "dist/server-DS6X9y1L.js",
93
+ "line": 2279
94
94
  },
95
95
  "mastraObservationalMemoryTable": {
96
96
  "types": "dist/schema.d.ts",
@@ -119,8 +119,8 @@
119
119
  },
120
120
  "mastraStorage": {
121
121
  "types": "dist/server/storage.d.ts",
122
- "implementation": "dist/server-BD08ym0I.js",
123
- "line": 1523
122
+ "implementation": "dist/server-DS6X9y1L.js",
123
+ "line": 1536
124
124
  },
125
125
  "mastraThreadsTable": {
126
126
  "types": "dist/schema.d.ts",
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_server = require("./server-B6-3iw37.cjs");
2
+ const require_server = require("./server-CwHPmdFF.cjs");
3
3
  const require_schema = require("./schema.cjs");
4
4
  let _mastra_core_cache = require("@mastra/core/cache");
5
5
  let _mastra_core_storage = require("@mastra/core/storage");
@@ -2791,38 +2791,29 @@ var ConvexVector = class extends _mastra_core_vector.MastraVector {
2791
2791
  if (!value.some((cond) => this.matchesFilterConditions(recordMetadata, cond))) return false;
2792
2792
  continue;
2793
2793
  }
2794
- if (typeof value === "object" && value !== null && "$in" in value) {
2795
- if (!Array.isArray(value.$in) || !value.$in.includes(recordMetadata[key])) return false;
2796
- continue;
2797
- }
2798
- if (typeof value === "object" && value !== null && "$nin" in value) {
2799
- if (Array.isArray(value.$nin) && value.$nin.includes(recordMetadata[key])) return false;
2800
- continue;
2801
- }
2802
- if (typeof value === "object" && value !== null && "$gt" in value) {
2803
- if (!(recordMetadata[key] > value.$gt)) return false;
2804
- continue;
2805
- }
2806
- if (typeof value === "object" && value !== null && "$gte" in value) {
2807
- if (!(recordMetadata[key] >= value.$gte)) return false;
2808
- continue;
2809
- }
2810
- if (typeof value === "object" && value !== null && "$lt" in value) {
2811
- if (!(recordMetadata[key] < value.$lt)) return false;
2812
- continue;
2813
- }
2814
- if (typeof value === "object" && value !== null && "$lte" in value) {
2815
- if (!(recordMetadata[key] <= value.$lte)) return false;
2816
- continue;
2817
- }
2818
- if (typeof value === "object" && value !== null && "$ne" in value) {
2819
- if (recordMetadata[key] === value.$ne) return false;
2794
+ if (typeof value === "object" && value !== null && !Array.isArray(value) && Object.keys(value).some((k) => k.startsWith("$"))) {
2795
+ if (!this.matchesFieldOperators(recordMetadata[key], value)) return false;
2820
2796
  continue;
2821
2797
  }
2822
2798
  if (recordMetadata[key] !== value) return false;
2823
2799
  }
2824
2800
  return true;
2825
2801
  }
2802
+ matchesFieldOperators(fieldValue, operators) {
2803
+ return Object.entries(operators).every(([operator, operand]) => {
2804
+ switch (operator) {
2805
+ case "$eq": return fieldValue === operand;
2806
+ case "$ne": return fieldValue !== operand;
2807
+ case "$in": return Array.isArray(operand) && operand.includes(fieldValue);
2808
+ case "$nin": return !(Array.isArray(operand) && operand.includes(fieldValue));
2809
+ case "$gt": return fieldValue > operand;
2810
+ case "$gte": return fieldValue >= operand;
2811
+ case "$lt": return fieldValue < operand;
2812
+ case "$lte": return fieldValue <= operand;
2813
+ default: return false;
2814
+ }
2815
+ });
2816
+ }
2826
2817
  async callStorage(request) {
2827
2818
  return this.client.callStorage(request);
2828
2819
  }