@mastra/mongodb 1.19.0-alpha.0 → 1.19.1-alpha.0

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
@@ -9,7 +9,7 @@ import { MessageList } from "@mastra/core/agent";
9
9
  import { saveScorePayloadSchema } from "@mastra/core/evals";
10
10
  import { skillSnapshotFieldValuesEqual } from "@mastra/core/storage/domains/skills";
11
11
  //#region package.json
12
- var version = "1.19.0-alpha.0";
12
+ var version = "1.19.1-alpha.0";
13
13
  //#endregion
14
14
  //#region src/vector/filter.ts
15
15
  /**
@@ -11014,7 +11014,7 @@ var MongoDBSkillsStorage = class MongoDBSkillsStorage extends SkillsStorage {
11014
11014
  }
11015
11015
  async list(args) {
11016
11016
  try {
11017
- const { page = 0, perPage: perPageInput, orderBy, authorId, visibility, metadata } = args || {};
11017
+ const { page = 0, perPage: perPageInput, orderBy, authorId, visibility, metadata, status, entityIds } = args || {};
11018
11018
  const { field, direction } = this.parseOrderBy(orderBy);
11019
11019
  if (page < 0) throw new MastraError({
11020
11020
  id: createStorageErrorId("MONGODB", "LIST_SKILLS", "INVALID_PAGE"),
@@ -11024,8 +11024,17 @@ var MongoDBSkillsStorage = class MongoDBSkillsStorage extends SkillsStorage {
11024
11024
  }, /* @__PURE__ */ new Error("page must be >= 0"));
11025
11025
  const perPage = normalizePerPage(perPageInput, 100);
11026
11026
  const { offset, perPage: perPageForResponse } = calculatePagination(page, perPageInput, perPage);
11027
+ if (entityIds && entityIds.length === 0) return {
11028
+ skills: [],
11029
+ total: 0,
11030
+ page,
11031
+ perPage: perPageForResponse,
11032
+ hasMore: false
11033
+ };
11027
11034
  const collection = await this.getCollection(TABLE_SKILLS);
11028
11035
  const filter = {};
11036
+ if (entityIds && entityIds.length > 0) filter.id = { $in: entityIds };
11037
+ if (status) filter.status = status;
11029
11038
  if (authorId) filter.authorId = authorId;
11030
11039
  if (visibility) filter.visibility = visibility;
11031
11040
  if (metadata) for (const [key, value] of Object.entries(metadata)) filter[`metadata.${key}`] = value;