@mastra/deployer 1.83.0-alpha.3 → 1.83.0-alpha.5

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.
@@ -1,5 +1,5 @@
1
1
  import type { Mastra } from '@mastra/core/mastra';
2
- import type { HonoBindings, HonoVariables } from '../_types/@mastra_hono@1.7.25-alpha.3/dist/index.js';
2
+ import type { HonoBindings, HonoVariables } from '../_types/@mastra_hono@1.7.25-alpha.5/dist/index.js';
3
3
  import { Hono } from 'hono';
4
4
  import type { ServerBundleOptions } from './types.js';
5
5
  type Bindings = HonoBindings;
@@ -4029,16 +4029,8 @@ var MastraServer$2 = class extends MastraServer {
4029
4029
  const routes = await this.registerSchemaApiRoutes();
4030
4030
  if (!await this.buildCustomRouteHandler(routes)) return;
4031
4031
  for (const route of routes) {
4032
- const serverRoute = {
4033
- method: route.method,
4034
- path: route.path,
4035
- responseType: "json",
4036
- handler: async () => {},
4037
- requiresAuth: route.requiresAuth,
4038
- requiresPermission: route.requiresPermission,
4039
- fga: route.fga
4040
- };
4041
4032
  const routeHandler = async (c) => {
4033
+ const { match, serverRoute, customRouteAuthConfig } = this.resolveCustomRouteAuth(c.req.url, c.req.method, c.req.path, route);
4042
4034
  const authError = await this.checkRouteAuth(serverRoute, {
4043
4035
  path: c.req.path,
4044
4036
  method: c.req.method,
@@ -4046,7 +4038,8 @@ var MastraServer$2 = class extends MastraServer {
4046
4038
  getQuery: (name) => c.req.query(name),
4047
4039
  requestContext: c.get("requestContext"),
4048
4040
  request: c.req.raw,
4049
- buildAuthorizeContext: () => c
4041
+ buildAuthorizeContext: () => c,
4042
+ customRouteAuthConfig
4050
4043
  });
4051
4044
  if (authError) {
4052
4045
  if (authError.headers) for (const [key, value] of Object.entries(authError.headers)) c.header(key, value);
@@ -4083,7 +4076,7 @@ var MastraServer$2 = class extends MastraServer {
4083
4076
  const fgaError = await checkRouteFGA(this.mastra, serverRoute, c.get("requestContext"), {
4084
4077
  ...Object.fromEntries(new URL(c.req.url).searchParams.entries()),
4085
4078
  ...bodyParams,
4086
- ...c.req.param()
4079
+ ...match ? match.params : c.req.param()
4087
4080
  });
4088
4081
  if (fgaError) return c.json({
4089
4082
  error: fgaError.error,