@mastra/mysql 0.10.1 → 0.10.2-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
|
@@ -9989,6 +9989,7 @@ var SkillsMySQL = class SkillsMySQL extends SkillsStorage {
|
|
|
9989
9989
|
status: row.status ?? "draft",
|
|
9990
9990
|
activeVersionId: row.activeVersionId ?? void 0,
|
|
9991
9991
|
authorId: row.authorId ?? void 0,
|
|
9992
|
+
visibility: row.visibility ?? void 0,
|
|
9992
9993
|
favoriteCount: row.favoriteCount === null || row.favoriteCount === void 0 ? 0 : Number(row.favoriteCount),
|
|
9993
9994
|
createdAt: row.createdAt instanceof Date ? row.createdAt : new Date(row.createdAt),
|
|
9994
9995
|
updatedAt: row.updatedAt instanceof Date ? row.updatedAt : new Date(row.updatedAt)
|
|
@@ -10032,6 +10033,7 @@ var SkillsMySQL = class SkillsMySQL extends SkillsStorage {
|
|
|
10032
10033
|
const { skill } = input;
|
|
10033
10034
|
try {
|
|
10034
10035
|
const now = /* @__PURE__ */ new Date();
|
|
10036
|
+
const visibility = skill.visibility ?? (skill.authorId ? "private" : void 0);
|
|
10035
10037
|
await this.operations.insert({
|
|
10036
10038
|
tableName: TABLE_SKILLS,
|
|
10037
10039
|
record: {
|
|
@@ -10039,12 +10041,13 @@ var SkillsMySQL = class SkillsMySQL extends SkillsStorage {
|
|
|
10039
10041
|
status: "draft",
|
|
10040
10042
|
activeVersionId: null,
|
|
10041
10043
|
authorId: skill.authorId ?? null,
|
|
10044
|
+
visibility: visibility ?? null,
|
|
10042
10045
|
favoriteCount: 0,
|
|
10043
10046
|
createdAt: now,
|
|
10044
10047
|
updatedAt: now
|
|
10045
10048
|
}
|
|
10046
10049
|
});
|
|
10047
|
-
const { id: _id, authorId: _authorId, ...snapshotConfig } = skill;
|
|
10050
|
+
const { id: _id, authorId: _authorId, visibility: _visibility, ...snapshotConfig } = skill;
|
|
10048
10051
|
const versionId = crypto.randomUUID();
|
|
10049
10052
|
try {
|
|
10050
10053
|
await this.createVersion({
|
|
@@ -10067,6 +10070,7 @@ var SkillsMySQL = class SkillsMySQL extends SkillsStorage {
|
|
|
10067
10070
|
status: "draft",
|
|
10068
10071
|
activeVersionId: void 0,
|
|
10069
10072
|
authorId: skill.authorId,
|
|
10073
|
+
visibility,
|
|
10070
10074
|
favoriteCount: 0,
|
|
10071
10075
|
createdAt: now,
|
|
10072
10076
|
updatedAt: now
|
|
@@ -10090,11 +10094,12 @@ var SkillsMySQL = class SkillsMySQL extends SkillsStorage {
|
|
|
10090
10094
|
text: `Skill ${id} not found`,
|
|
10091
10095
|
details: { skillId: id }
|
|
10092
10096
|
});
|
|
10093
|
-
const { authorId, activeVersionId, status, ...configFields } = updates;
|
|
10097
|
+
const { authorId, visibility, activeVersionId, status, ...configFields } = updates;
|
|
10094
10098
|
const configFieldNames = SNAPSHOT_FIELDS$1;
|
|
10095
10099
|
const hasConfigUpdate = configFieldNames.some((field) => field in configFields);
|
|
10096
10100
|
const updateData = { updatedAt: /* @__PURE__ */ new Date() };
|
|
10097
10101
|
if (authorId !== void 0) updateData.authorId = authorId;
|
|
10102
|
+
if (visibility !== void 0) updateData.visibility = visibility;
|
|
10098
10103
|
if (activeVersionId !== void 0) {
|
|
10099
10104
|
updateData.activeVersionId = activeVersionId;
|
|
10100
10105
|
if (status === void 0) updateData.status = "published";
|