@mastra/deployer 1.58.0-alpha.12 → 1.58.0-alpha.13

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 +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;AAc5B,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;AAwCF,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;2CAkahE;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAmC,mDAwHlG"}
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;AAc5B,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;AA8CF,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;2CAsahE;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAmC,mDAwHlG"}
@@ -3550,8 +3550,8 @@ var MastraServer$1 = class extends MastraServer {
3550
3550
  });
3551
3551
  }
3552
3552
  async registerCustomApiRoutes() {
3553
- if (!await this.buildCustomRouteHandler()) return;
3554
- const routes = this.customApiRoutes ?? this.mastra.getServer()?.apiRoutes ?? [];
3553
+ const routes = await this.registerSchemaApiRoutes();
3554
+ if (!await this.buildCustomRouteHandler(routes)) return;
3555
3555
  for (const route of routes) {
3556
3556
  const serverRoute = {
3557
3557
  method: route.method,
@@ -4363,6 +4363,9 @@ const getStudioPath = () => {
4363
4363
  if (import.meta.url) __dirname = dirname(fileURLToPath(import.meta.url));
4364
4364
  return process.env.MASTRA_STUDIO_PATH || join(__dirname, "studio");
4365
4365
  };
4366
+ function isSchemaApiRoute(route) {
4367
+ return "_mastraSchemaRoute" in route && route._mastraSchemaRoute === true;
4368
+ }
4366
4369
  const DEFAULT_CORS_ALLOW_METHODS = [
4367
4370
  "GET",
4368
4371
  "POST",
@@ -4394,7 +4397,8 @@ function getCorsConfig(serverCors, credentialsDefault) {
4394
4397
  };
4395
4398
  }
4396
4399
  function getRouteCorsConfig(apiRoutes, pathname, method) {
4397
- return (findMatchingCustomRoute(pathname, method, apiRoutes)?.route)?.cors;
4400
+ const route = findMatchingCustomRoute(pathname, method, apiRoutes)?.route;
4401
+ return route && !isSchemaApiRoute(route) ? route.cors : void 0;
4398
4402
  }
4399
4403
  function getToolExports(tools) {
4400
4404
  try {
@@ -4420,7 +4424,8 @@ async function createHonoServer(mastra, options = { tools: {} }) {
4420
4424
  const apiPrefix = server?.apiPrefix ?? "/api";
4421
4425
  const a2aTaskStore = new InMemoryTaskStore();
4422
4426
  const processedRoutes = (server?.apiRoutes)?.map((route) => {
4423
- if ("openapi" in route && route.openapi) {
4427
+ if (isSchemaApiRoute(route)) return route;
4428
+ if (route.openapi) {
4424
4429
  const existingMiddleware = route.middleware ? Array.isArray(route.middleware) ? route.middleware : [route.middleware] : [];
4425
4430
  return {
4426
4431
  ...route,