@mastra/deployer 1.3.0 → 1.4.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.
@@ -3271,7 +3271,7 @@ var MastraServer = class extends MastraServer$1 {
3271
3271
  const queryParams = normalizeQueryParams(request.queries());
3272
3272
  let body;
3273
3273
  let bodyParseError;
3274
- if (route.method === "POST" || route.method === "PUT" || route.method === "PATCH") {
3274
+ if (route.method === "POST" || route.method === "PUT" || route.method === "PATCH" || route.method === "DELETE") {
3275
3275
  const contentType = request.header("content-type") || "";
3276
3276
  if (contentType.includes("multipart/form-data")) {
3277
3277
  try {
@@ -3490,6 +3490,21 @@ var MastraServer = class extends MastraServer$1 {
3490
3490
  }
3491
3491
  );
3492
3492
  }
3493
+ async registerCustomApiRoutes() {
3494
+ const routes = this.customApiRoutes ?? this.mastra.getServer()?.apiRoutes;
3495
+ if (!routes || routes.length === 0) return;
3496
+ for (const route of routes) {
3497
+ const handler = "handler" in route && route.handler ? route.handler : "createHandler" in route ? await route.createHandler({ mastra: this.mastra }) : void 0;
3498
+ if (!handler) continue;
3499
+ const middlewares = [];
3500
+ if (route.middleware) {
3501
+ middlewares.push(...Array.isArray(route.middleware) ? route.middleware : [route.middleware]);
3502
+ }
3503
+ const allHandlers = [...middlewares, handler];
3504
+ const method = route.method.toLowerCase();
3505
+ this.app[method](route.path, allHandlers[0], ...allHandlers.slice(1));
3506
+ }
3507
+ }
3493
3508
  registerContextMiddleware() {
3494
3509
  this.app.use("*", this.createContextMiddleware());
3495
3510
  }