@mastra/mysql 0.10.1 → 0.10.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-mysql
3
3
  description: Documentation for @mastra/mysql. Use when working with @mastra/mysql APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/mysql"
6
- version: "0.10.1"
6
+ version: "0.10.2"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.10.1",
2
+ "version": "0.10.2",
3
3
  "package": "@mastra/mysql",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -9990,6 +9990,7 @@ var SkillsMySQL = class SkillsMySQL extends _mastra_core_storage.SkillsStorage {
9990
9990
  status: row.status ?? "draft",
9991
9991
  activeVersionId: row.activeVersionId ?? void 0,
9992
9992
  authorId: row.authorId ?? void 0,
9993
+ visibility: row.visibility ?? void 0,
9993
9994
  favoriteCount: row.favoriteCount === null || row.favoriteCount === void 0 ? 0 : Number(row.favoriteCount),
9994
9995
  createdAt: row.createdAt instanceof Date ? row.createdAt : new Date(row.createdAt),
9995
9996
  updatedAt: row.updatedAt instanceof Date ? row.updatedAt : new Date(row.updatedAt)
@@ -10033,6 +10034,7 @@ var SkillsMySQL = class SkillsMySQL extends _mastra_core_storage.SkillsStorage {
10033
10034
  const { skill } = input;
10034
10035
  try {
10035
10036
  const now = /* @__PURE__ */ new Date();
10037
+ const visibility = skill.visibility ?? (skill.authorId ? "private" : void 0);
10036
10038
  await this.operations.insert({
10037
10039
  tableName: _mastra_core_storage.TABLE_SKILLS,
10038
10040
  record: {
@@ -10040,12 +10042,13 @@ var SkillsMySQL = class SkillsMySQL extends _mastra_core_storage.SkillsStorage {
10040
10042
  status: "draft",
10041
10043
  activeVersionId: null,
10042
10044
  authorId: skill.authorId ?? null,
10045
+ visibility: visibility ?? null,
10043
10046
  favoriteCount: 0,
10044
10047
  createdAt: now,
10045
10048
  updatedAt: now
10046
10049
  }
10047
10050
  });
10048
- const { id: _id, authorId: _authorId, ...snapshotConfig } = skill;
10051
+ const { id: _id, authorId: _authorId, visibility: _visibility, ...snapshotConfig } = skill;
10049
10052
  const versionId = crypto.randomUUID();
10050
10053
  try {
10051
10054
  await this.createVersion({
@@ -10068,6 +10071,7 @@ var SkillsMySQL = class SkillsMySQL extends _mastra_core_storage.SkillsStorage {
10068
10071
  status: "draft",
10069
10072
  activeVersionId: void 0,
10070
10073
  authorId: skill.authorId,
10074
+ visibility,
10071
10075
  favoriteCount: 0,
10072
10076
  createdAt: now,
10073
10077
  updatedAt: now
@@ -10091,11 +10095,12 @@ var SkillsMySQL = class SkillsMySQL extends _mastra_core_storage.SkillsStorage {
10091
10095
  text: `Skill ${id} not found`,
10092
10096
  details: { skillId: id }
10093
10097
  });
10094
- const { authorId, activeVersionId, status, ...configFields } = updates;
10098
+ const { authorId, visibility, activeVersionId, status, ...configFields } = updates;
10095
10099
  const configFieldNames = SNAPSHOT_FIELDS$1;
10096
10100
  const hasConfigUpdate = configFieldNames.some((field) => field in configFields);
10097
10101
  const updateData = { updatedAt: /* @__PURE__ */ new Date() };
10098
10102
  if (authorId !== void 0) updateData.authorId = authorId;
10103
+ if (visibility !== void 0) updateData.visibility = visibility;
10099
10104
  if (activeVersionId !== void 0) {
10100
10105
  updateData.activeVersionId = activeVersionId;
10101
10106
  if (status === void 0) updateData.status = "published";