@mastra/client-js 1.1.0 → 1.1.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/CHANGELOG.md +9 -0
- package/dist/docs/README.md +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +22 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -4
- package/dist/index.js.map +1 -1
- package/dist/resources/base.d.ts.map +1 -1
- package/dist/types.d.ts +26 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @mastra/client-js
|
|
2
2
|
|
|
3
|
+
## 1.1.1-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Improved workspace filesystem error handling: return 404 for not-found errors instead of 500, show user-friendly error messages in UI, and add MastraClientError class with status/body properties for better error handling ([#12533](https://github.com/mastra-ai/mastra/pull/12533))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`e6fc281`](https://github.com/mastra-ai/mastra/commit/e6fc281896a3584e9e06465b356a44fe7faade65), [`97be6c8`](https://github.com/mastra-ai/mastra/commit/97be6c8963130fca8a664fcf99d7b3a38e463595), [`5fe1fe0`](https://github.com/mastra-ai/mastra/commit/5fe1fe0109faf2c87db34b725d8a4571a594f80e), [`f6673b8`](https://github.com/mastra-ai/mastra/commit/f6673b893b65b7d273ad25ead42e990704cc1e17), [`cd6be8a`](https://github.com/mastra-ai/mastra/commit/cd6be8ad32741cd41cabf508355bb31b71e8a5bd), [`9eb4e8e`](https://github.com/mastra-ai/mastra/commit/9eb4e8e39efbdcfff7a40ff2ce07ce2714c65fa8), [`aa37c84`](https://github.com/mastra-ai/mastra/commit/aa37c84d29b7db68c72517337932ef486c316275), [`47eba72`](https://github.com/mastra-ai/mastra/commit/47eba72f0397d0d14fbe324b97940c3d55e5a525)]:
|
|
10
|
+
- @mastra/core@1.2.0-alpha.0
|
|
11
|
+
|
|
3
12
|
## 1.1.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
package/dist/docs/README.md
CHANGED
package/dist/docs/SKILL.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1234,6 +1234,23 @@ async function processMastraStream({
|
|
|
1234
1234
|
});
|
|
1235
1235
|
}
|
|
1236
1236
|
|
|
1237
|
+
// src/types.ts
|
|
1238
|
+
var MastraClientError = class extends Error {
|
|
1239
|
+
/** HTTP status code */
|
|
1240
|
+
status;
|
|
1241
|
+
/** HTTP status text (e.g., "Not Found", "Internal Server Error") */
|
|
1242
|
+
statusText;
|
|
1243
|
+
/** Parsed response body if available */
|
|
1244
|
+
body;
|
|
1245
|
+
constructor(status, statusText, message, body) {
|
|
1246
|
+
super(message);
|
|
1247
|
+
this.name = "MastraClientError";
|
|
1248
|
+
this.status = status;
|
|
1249
|
+
this.statusText = statusText;
|
|
1250
|
+
this.body = body;
|
|
1251
|
+
}
|
|
1252
|
+
};
|
|
1253
|
+
|
|
1237
1254
|
// src/resources/base.ts
|
|
1238
1255
|
var BaseResource = class _BaseResource {
|
|
1239
1256
|
options;
|
|
@@ -1292,16 +1309,17 @@ var BaseResource = class _BaseResource {
|
|
|
1292
1309
|
});
|
|
1293
1310
|
if (!response.ok) {
|
|
1294
1311
|
const errorBody = await response.text();
|
|
1312
|
+
let parsedBody;
|
|
1295
1313
|
let errorMessage = `HTTP error! status: ${response.status}`;
|
|
1296
1314
|
try {
|
|
1297
|
-
|
|
1298
|
-
errorMessage += ` - ${JSON.stringify(
|
|
1315
|
+
parsedBody = JSON.parse(errorBody);
|
|
1316
|
+
errorMessage += ` - ${JSON.stringify(parsedBody)}`;
|
|
1299
1317
|
} catch {
|
|
1300
1318
|
if (errorBody) {
|
|
1301
1319
|
errorMessage += ` - ${errorBody}`;
|
|
1302
1320
|
}
|
|
1303
1321
|
}
|
|
1304
|
-
throw new
|
|
1322
|
+
throw new MastraClientError(response.status, response.statusText, errorMessage, parsedBody);
|
|
1305
1323
|
}
|
|
1306
1324
|
if (options.stream) {
|
|
1307
1325
|
return response;
|
|
@@ -4940,6 +4958,7 @@ function createTool(opts) {
|
|
|
4940
4958
|
|
|
4941
4959
|
exports.ClientTool = ClientTool;
|
|
4942
4960
|
exports.MastraClient = MastraClient;
|
|
4961
|
+
exports.MastraClientError = MastraClientError;
|
|
4943
4962
|
exports.createTool = createTool;
|
|
4944
4963
|
//# sourceMappingURL=index.cjs.map
|
|
4945
4964
|
//# sourceMappingURL=index.cjs.map
|