@mastra/deployer 1.29.0-alpha.0 → 1.29.0-alpha.2

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @mastra/deployer
2
2
 
3
+ ## 1.29.0-alpha.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`9e973b0`](https://github.com/mastra-ai/mastra/commit/9e973b010dacfa15ac82b0072897319f5234b90a), [`dd934a0`](https://github.com/mastra-ai/mastra/commit/dd934a0982ce0f78712fbd559e4f2410bf594b39), [`73f2809`](https://github.com/mastra-ai/mastra/commit/73f2809721db24e98cdf122539652a455211b450), [`f85ab4a`](https://github.com/mastra-ai/mastra/commit/f85ab4a3cce3d4376a4fc3c08feeb380cee2927c), [`aedeea4`](https://github.com/mastra-ai/mastra/commit/aedeea48a94f728323f040478775076b9574be50), [`a9a3463`](https://github.com/mastra-ai/mastra/commit/a9a34638b16d0956f35290a52ed0a44cd926110b), [`441670a`](https://github.com/mastra-ai/mastra/commit/441670a02c9dc7731c52674f55481e7848a84523), [`8126d86`](https://github.com/mastra-ai/mastra/commit/8126d8638411eacfafdc29036ac998e8757ea66f), [`ae97520`](https://github.com/mastra-ai/mastra/commit/ae975206fdb0f6ef03c4d5bf94f7dc7c3f706c02), [`441670a`](https://github.com/mastra-ai/mastra/commit/441670a02c9dc7731c52674f55481e7848a84523)]:
8
+ - @mastra/core@1.29.0-alpha.2
9
+ - @mastra/server@1.29.0-alpha.2
10
+
11
+ ## 1.29.0-alpha.1
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [[`7a7b313`](https://github.com/mastra-ai/mastra/commit/7a7b3138fb3bcf0b0c740eaea07971e43d330ef3), [`a6dac0a`](https://github.com/mastra-ai/mastra/commit/a6dac0a40c7181161b1add4e8534f962bcbc9aa7), [`9cef83b`](https://github.com/mastra-ai/mastra/commit/9cef83b8a642b8098747772921e3523b492bafbc), [`d30e215`](https://github.com/mastra-ai/mastra/commit/d30e2156c746bc9fd791745cec1cc24377b66789), [`73b45fa`](https://github.com/mastra-ai/mastra/commit/73b45facdef4fbcb8af710c50f0646f18619dbaa), [`7a7b313`](https://github.com/mastra-ai/mastra/commit/7a7b3138fb3bcf0b0c740eaea07971e43d330ef3)]:
16
+ - @mastra/core@1.29.0-alpha.1
17
+ - @mastra/server@1.29.0-alpha.1
18
+
3
19
  ## 1.29.0-alpha.0
4
20
 
5
21
  ### Patch Changes
@@ -3,7 +3,7 @@ name: mastra-deployer
3
3
  description: Documentation for @mastra/deployer. Use when working with @mastra/deployer APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/deployer"
6
- version: "1.29.0-alpha.0"
6
+ version: "1.29.0-alpha.2"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.29.0-alpha.0",
2
+ "version": "1.29.0-alpha.2",
3
3
  "package": "@mastra/deployer",
4
4
  "exports": {
5
5
  "Deps": {
@@ -3668,12 +3668,9 @@ var MastraServer = class extends serverAdapter.MastraServer {
3668
3668
  );
3669
3669
  }
3670
3670
  async registerCustomApiRoutes() {
3671
- const routes = this.customApiRoutes ?? this.mastra.getServer()?.apiRoutes;
3672
- if (!routes || routes.length === 0) return;
3671
+ if (!await this.buildCustomRouteHandler()) return;
3672
+ const routes = this.customApiRoutes ?? this.mastra.getServer()?.apiRoutes ?? [];
3673
3673
  for (const route of routes) {
3674
- const handler = "handler" in route && route.handler ? route.handler : "createHandler" in route ? await route.createHandler({ mastra: this.mastra }) : void 0;
3675
- if (!handler) continue;
3676
- const middlewares = [];
3677
3674
  const serverRoute = {
3678
3675
  method: route.method,
3679
3676
  path: route.path,
@@ -3682,7 +3679,7 @@ var MastraServer = class extends serverAdapter.MastraServer {
3682
3679
  },
3683
3680
  requiresAuth: route.requiresAuth
3684
3681
  };
3685
- middlewares.push(async (c, next) => {
3682
+ const routeHandler = async (c) => {
3686
3683
  const authError = await this.checkRouteAuth(serverRoute, {
3687
3684
  path: c.req.path,
3688
3685
  method: c.req.method,
@@ -3709,14 +3706,24 @@ var MastraServer = class extends serverAdapter.MastraServer {
3709
3706
  }
3710
3707
  }
3711
3708
  }
3712
- return next();
3713
- });
3714
- if (route.middleware) {
3715
- middlewares.push(...Array.isArray(route.middleware) ? route.middleware : [route.middleware]);
3716
- }
3717
- const allHandlers = [...middlewares, handler];
3709
+ const reqHeaders = {};
3710
+ c.req.raw.headers.forEach((v, k) => {
3711
+ reqHeaders[k] = v;
3712
+ });
3713
+ const response = await this.handleCustomRouteRequest(
3714
+ c.req.url,
3715
+ c.req.method,
3716
+ reqHeaders,
3717
+ c.req.raw.body,
3718
+ c.get("requestContext")
3719
+ );
3720
+ if (!response) {
3721
+ return c.json({ error: "Not Found" }, 404);
3722
+ }
3723
+ return response;
3724
+ };
3718
3725
  const method = route.method.toLowerCase();
3719
- this.app[method](route.path, allHandlers[0], ...allHandlers.slice(1));
3726
+ this.app[method](route.path, routeHandler);
3720
3727
  }
3721
3728
  }
3722
3729
  registerContextMiddleware() {