@mastra/cloudflare-d1 1.0.6-alpha.0 → 1.0.6

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.js CHANGED
@@ -1124,12 +1124,15 @@ var MemoryStorageD1 = class extends MemoryStorage {
1124
1124
  );
1125
1125
  }
1126
1126
  }
1127
- async getThreadById({ threadId }) {
1127
+ async getThreadById({
1128
+ threadId,
1129
+ resourceId
1130
+ }) {
1128
1131
  const thread = await this.#db.load({
1129
1132
  tableName: TABLE_THREADS,
1130
1133
  keys: { id: threadId }
1131
1134
  });
1132
- if (!thread) return null;
1135
+ if (!thread || resourceId !== void 0 && thread.resourceId !== resourceId) return null;
1133
1136
  try {
1134
1137
  return {
1135
1138
  ...thread,