@mastra/mysql 0.8.3 → 0.8.4
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/CHANGELOG.md +18 -0
- package/dist/index.cjs +14 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/knowledge/index.d.ts.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @mastra/mysql
|
|
2
2
|
|
|
3
|
+
## 0.8.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fixed the store package failing to load when installed with `@mastra/core` older than 1.63.1, and corrected the minimum supported core version. ([#22548](https://github.com/mastra-ai/mastra/pull/22548))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`0a9d29c`](https://github.com/mastra-ai/mastra/commit/0a9d29c0c4dbbaa6afc1c8146cdd41759cbd4002)]:
|
|
10
|
+
- @mastra/core@1.63.2
|
|
11
|
+
|
|
12
|
+
## 0.8.4-alpha.0
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Fixed the store package failing to load when installed with `@mastra/core` older than 1.63.1, and corrected the minimum supported core version. ([#22548](https://github.com/mastra-ai/mastra/pull/22548))
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [[`0a9d29c`](https://github.com/mastra-ai/mastra/commit/0a9d29c0c4dbbaa6afc1c8146cdd41759cbd4002)]:
|
|
19
|
+
- @mastra/core@1.63.2-alpha.0
|
|
20
|
+
|
|
3
21
|
## 0.8.3
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -3903,6 +3903,18 @@ var FavoritesMySQL = class FavoritesMySQL extends _mastra_core_storage.Favorites
|
|
|
3903
3903
|
};
|
|
3904
3904
|
//#endregion
|
|
3905
3905
|
//#region src/storage/domains/knowledge/index.ts
|
|
3906
|
+
let assertDescriptionWithinBound;
|
|
3907
|
+
async function assertKnowledgeDescriptionWithinBoundCompat(description) {
|
|
3908
|
+
let assertWithinBound = assertDescriptionWithinBound;
|
|
3909
|
+
if (!assertWithinBound) {
|
|
3910
|
+
const resolvedAssert = (await import("@mastra/core/storage")).assertKnowledgeDescriptionWithinBound ?? ((value) => {
|
|
3911
|
+
if (value !== void 0 && value.length > 400) throw new Error("Knowledge node description exceeds the 400 UTF-16 code unit limit");
|
|
3912
|
+
});
|
|
3913
|
+
assertDescriptionWithinBound = resolvedAssert;
|
|
3914
|
+
assertWithinBound = resolvedAssert;
|
|
3915
|
+
}
|
|
3916
|
+
assertWithinBound(description);
|
|
3917
|
+
}
|
|
3906
3918
|
function mysqlSql(sql) {
|
|
3907
3919
|
return sql.replaceAll("jsonb(?)", "CAST(? AS JSON)").replaceAll("INSERT OR IGNORE", "INSERT IGNORE").replaceAll("\"", "`");
|
|
3908
3920
|
}
|
|
@@ -4098,7 +4110,7 @@ var KnowledgeMySQL = class extends _mastra_core_storage.KnowledgeStorage {
|
|
|
4098
4110
|
});
|
|
4099
4111
|
}
|
|
4100
4112
|
async createNode(input) {
|
|
4101
|
-
|
|
4113
|
+
await assertKnowledgeDescriptionWithinBoundCompat(input.description);
|
|
4102
4114
|
const scope = (0, _mastra_core_storage.canonicalizeKnowledgeScope)(input.scope);
|
|
4103
4115
|
return this.#transaction(async (tx) => {
|
|
4104
4116
|
const existing = await this.#getNodeByName(tx, input.name, scope);
|
|
@@ -4186,7 +4198,7 @@ var KnowledgeMySQL = class extends _mastra_core_storage.KnowledgeStorage {
|
|
|
4186
4198
|
})).rows.map(parseNode);
|
|
4187
4199
|
}
|
|
4188
4200
|
async updateNode(input) {
|
|
4189
|
-
|
|
4201
|
+
await assertKnowledgeDescriptionWithinBoundCompat(input.description);
|
|
4190
4202
|
return this.#transaction(async (tx) => {
|
|
4191
4203
|
const existing = await this.#getNode(tx, input.id);
|
|
4192
4204
|
if (!existing) throw new _mastra_core_storage.KnowledgeNotFoundError("node", input.id);
|