@mastra/deployer 1.42.0-alpha.3 → 1.42.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 +30 -0
- package/dist/build/bundler.cjs +3 -3
- package/dist/build/bundler.js +1 -1
- package/dist/build/index.cjs +7 -7
- package/dist/build/index.js +2 -2
- package/dist/build/plugins/local-storage-detector.d.ts +6 -4
- package/dist/build/plugins/local-storage-detector.d.ts.map +1 -1
- package/dist/bundler/index.cjs +3 -3
- package/dist/bundler/index.js +1 -1
- package/dist/{chunk-UVEN22VX.cjs → chunk-4I6VIARR.cjs} +5 -5
- package/dist/{chunk-UVEN22VX.cjs.map → chunk-4I6VIARR.cjs.map} +1 -1
- package/dist/{chunk-GBDZZHB2.js → chunk-G2ZY3BL6.js} +3 -3
- package/dist/{chunk-GBDZZHB2.js.map → chunk-G2ZY3BL6.js.map} +1 -1
- package/dist/{chunk-4KPYOOLH.cjs → chunk-GPRMW5ZF.cjs} +4 -2
- package/dist/chunk-GPRMW5ZF.cjs.map +1 -0
- package/dist/{chunk-MZ3WIURS.js → chunk-H7Q36A6X.js} +3 -3
- package/dist/{chunk-MZ3WIURS.js.map → chunk-H7Q36A6X.js.map} +1 -1
- package/dist/{chunk-FQ5JFVJK.js → chunk-TG7R2YUM.js} +4 -2
- package/dist/chunk-TG7R2YUM.js.map +1 -0
- package/dist/{chunk-LITSHR6E.cjs → chunk-WE66TECO.cjs} +5 -5
- package/dist/{chunk-LITSHR6E.cjs.map → chunk-WE66TECO.cjs.map} +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/server/index.cjs +17 -8
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +17 -8
- package/dist/server/index.js.map +1 -1
- package/package.json +10 -10
- package/dist/chunk-4KPYOOLH.cjs.map +0 -1
- package/dist/chunk-FQ5JFVJK.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAIlD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAIhE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAa5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAoBnD,KAAK,QAAQ,GAAG,YAAY,CAAC;AAE7B,KAAK,SAAS,GAAG,aAAa,GAAG;IAC/B,OAAO,EAAE,GAAG,CAAC;QAAE,UAAU,EAAE,+BAA+B,CAAA;KAAE,CAAC,CAAC;CAC/D,CAAC;AAkCF,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,wCAmB/D;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,mBAER;cAegC,QAAQ;eAAa,SAAS;2CA0ZhE;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAmC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAIlD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAIhE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAa5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAoBnD,KAAK,QAAQ,GAAG,YAAY,CAAC;AAE7B,KAAK,SAAS,GAAG,aAAa,GAAG;IAC/B,OAAO,EAAE,GAAG,CAAC;QAAE,UAAU,EAAE,+BAA+B,CAAA;KAAE,CAAC,CAAC;CAC/D,CAAC;AAkCF,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,wCAmB/D;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,mBAER;cAegC,QAAQ;eAAa,SAAS;2CA0ZhE;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAmC,mDAqHlG"}
|
package/dist/server/index.js
CHANGED
|
@@ -3226,12 +3226,13 @@ var MastraServer = class extends MastraServer$1 {
|
|
|
3226
3226
|
request: c.req.raw
|
|
3227
3227
|
// Standard Request object with headers/cookies
|
|
3228
3228
|
};
|
|
3229
|
-
const
|
|
3230
|
-
|
|
3229
|
+
const requestContext = c.get("requestContext");
|
|
3230
|
+
const hasAuth = this.mastra.getStudio()?.auth || this.mastra.getServer()?.auth;
|
|
3231
|
+
if (hasAuth) {
|
|
3231
3232
|
const hasPermission = await loadHasPermission();
|
|
3232
3233
|
if (hasPermission) {
|
|
3233
|
-
const userPermissions =
|
|
3234
|
-
const permissionError = this.checkRoutePermission(route, userPermissions, hasPermission);
|
|
3234
|
+
const userPermissions = requestContext.get("mastra__userPermissions");
|
|
3235
|
+
const permissionError = this.checkRoutePermission(route, userPermissions, hasPermission, requestContext);
|
|
3235
3236
|
if (permissionError) {
|
|
3236
3237
|
return c.json(
|
|
3237
3238
|
{
|
|
@@ -3323,12 +3324,18 @@ var MastraServer = class extends MastraServer$1 {
|
|
|
3323
3324
|
return c.json({ error: authError.error }, authError.status);
|
|
3324
3325
|
}
|
|
3325
3326
|
}
|
|
3326
|
-
const
|
|
3327
|
-
|
|
3327
|
+
const requestContext = c.get("requestContext");
|
|
3328
|
+
const hasAuth = this.mastra.getStudio()?.auth || this.mastra.getServer()?.auth;
|
|
3329
|
+
if (hasAuth) {
|
|
3328
3330
|
const hasPermission = await loadHasPermission();
|
|
3329
3331
|
if (hasPermission) {
|
|
3330
|
-
const userPermissions =
|
|
3331
|
-
const permissionError = this.checkRoutePermission(
|
|
3332
|
+
const userPermissions = requestContext.get("mastra__userPermissions");
|
|
3333
|
+
const permissionError = this.checkRoutePermission(
|
|
3334
|
+
serverRoute,
|
|
3335
|
+
userPermissions,
|
|
3336
|
+
hasPermission,
|
|
3337
|
+
requestContext
|
|
3338
|
+
);
|
|
3332
3339
|
if (permissionError) {
|
|
3333
3340
|
return c.json(
|
|
3334
3341
|
{ error: permissionError.error, message: permissionError.message },
|
|
@@ -4452,6 +4459,8 @@ async function createNodeServer(mastra, options = { tools: {} }) {
|
|
|
4452
4459
|
} else {
|
|
4453
4460
|
await workerLifecycle.startEventEngine();
|
|
4454
4461
|
}
|
|
4462
|
+
void import('@mastra/core/telemetry').then(({ syncUsageTelemetry }) => syncUsageTelemetry(mastra)).catch(() => {
|
|
4463
|
+
});
|
|
4455
4464
|
const SHUTDOWN_TIMEOUT_MS = 5e3;
|
|
4456
4465
|
let shuttingDown = false;
|
|
4457
4466
|
const shutdown = async (signal) => {
|