@mastra/deployer 1.0.0-beta.23 → 1.0.0-beta.25

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,25 @@
1
1
  # @mastra/deployer
2
2
 
3
+ ## 1.0.0-beta.25
4
+
5
+ ### Patch Changes
6
+
7
+ - Add back `/api` route during `mastra dev` which was accidentally removed. ([#12055](https://github.com/mastra-ai/mastra/pull/12055))
8
+
9
+ - Updated dependencies [[`ed3e3dd`](https://github.com/mastra-ai/mastra/commit/ed3e3ddec69d564fe2b125e083437f76331f1283), [`3d1f794`](https://github.com/mastra-ai/mastra/commit/3d1f79420a16a0bb162794a21cfc10305912a554), [`6833c69`](https://github.com/mastra-ai/mastra/commit/6833c69607418d257750bbcdd84638993d343539), [`47b1c16`](https://github.com/mastra-ai/mastra/commit/47b1c16a01c7ffb6765fe1e499b49092f8b7eba3), [`47b1c16`](https://github.com/mastra-ai/mastra/commit/47b1c16a01c7ffb6765fe1e499b49092f8b7eba3), [`3a76a80`](https://github.com/mastra-ai/mastra/commit/3a76a80284cb71a0faa975abb3d4b2a9631e60cd), [`8538a0d`](https://github.com/mastra-ai/mastra/commit/8538a0d232619bf55dad7ddc2a8b0ca77c679a87), [`9312dcd`](https://github.com/mastra-ai/mastra/commit/9312dcd1c6f5b321929e7d382e763d95fdc030f5)]:
10
+ - @mastra/core@1.0.0-beta.25
11
+ - @mastra/server@1.0.0-beta.25
12
+
13
+ ## 1.0.0-beta.24
14
+
15
+ ### Patch Changes
16
+
17
+ - Fix a bug where `/openapi.json` was always generated during `mastra build`. The `server.build.openAPIDocs` setting is now observed. ([#11718](https://github.com/mastra-ai/mastra/pull/11718))
18
+
19
+ - Updated dependencies [[`1dbd8c7`](https://github.com/mastra-ai/mastra/commit/1dbd8c729fb6536ec52f00064d76b80253d346e9), [`c59e13c`](https://github.com/mastra-ai/mastra/commit/c59e13c7688284bd96b2baee3e314335003548de), [`f9a2509`](https://github.com/mastra-ai/mastra/commit/f9a25093ea72d210a5e52cfcb3bcc8b5e02dc25c), [`7a010c5`](https://github.com/mastra-ai/mastra/commit/7a010c56b846a313a49ae42fccd3d8de2b9f292d)]:
20
+ - @mastra/core@1.0.0-beta.24
21
+ - @mastra/server@1.0.0-beta.24
22
+
3
23
  ## 1.0.0-beta.23
4
24
 
5
25
  ### Patch Changes
@@ -29,4 +29,4 @@ docs/
29
29
  ## Version
30
30
 
31
31
  Package: @mastra/deployer
32
- Version: 1.0.0-beta.23
32
+ Version: 1.0.0-beta.25
@@ -5,7 +5,7 @@ description: Documentation for @mastra/deployer. Includes links to type definiti
5
5
 
6
6
  # @mastra/deployer Documentation
7
7
 
8
- > **Version**: 1.0.0-beta.23
8
+ > **Version**: 1.0.0-beta.25
9
9
  > **Package**: @mastra/deployer
10
10
 
11
11
  ## Quick Navigation
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.0-beta.23",
2
+ "version": "1.0.0-beta.25",
3
3
  "package": "@mastra/deployer",
4
4
  "exports": {
5
5
  "Deps": {
@@ -3553,6 +3553,126 @@ async function restartAllActiveWorkflowRunsHandler(c) {
3553
3553
  }
3554
3554
  }
3555
3555
 
3556
+ // src/server/handlers/root.ts
3557
+ async function rootHandler(c) {
3558
+ const baseUrl = new URL(c.req.url).origin;
3559
+ return c.html(
3560
+ /* html */
3561
+ `
3562
+ <!doctype html>
3563
+ <html lang="en">
3564
+ <head>
3565
+ <meta charset="UTF-8" />
3566
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
3567
+ <title>Mastra API</title>
3568
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/inter-ui/3.19.3/inter.min.css" />
3569
+ <style>
3570
+ body {
3571
+ margin: 0;
3572
+ padding: 0;
3573
+ background-color: #0d0d0d;
3574
+ color: #ffffff;
3575
+ font-family:
3576
+ 'Inter',
3577
+ -apple-system,
3578
+ BlinkMacSystemFont,
3579
+ system-ui,
3580
+ sans-serif;
3581
+ min-height: 100vh;
3582
+ display: flex;
3583
+ flex-direction: column;
3584
+ }
3585
+
3586
+ main {
3587
+ flex: 1;
3588
+ display: flex;
3589
+ flex-direction: column;
3590
+ align-items: center;
3591
+ justify-content: center;
3592
+ padding: 2rem;
3593
+ text-align: center;
3594
+ }
3595
+
3596
+ h1 {
3597
+ font-size: 4rem;
3598
+ font-weight: 600;
3599
+ margin: 0 0 1rem 0;
3600
+ background: linear-gradient(to right, #fff, #ccc);
3601
+ -webkit-background-clip: text;
3602
+ -webkit-text-fill-color: transparent;
3603
+ line-height: 1.2;
3604
+ }
3605
+
3606
+ .subtitle {
3607
+ color: #9ca3af;
3608
+ font-size: 1.25rem;
3609
+ max-width: 600px;
3610
+ margin: 0 auto 3rem auto;
3611
+ line-height: 1.6;
3612
+ }
3613
+
3614
+ .link {
3615
+ color: #ffffff;
3616
+ }
3617
+
3618
+ .link:hover {
3619
+ text-decoration: none;
3620
+ }
3621
+
3622
+ .docs-link {
3623
+ background-color: #1a1a1a;
3624
+ padding: 1rem 2rem;
3625
+ border-radius: 0.5rem;
3626
+ display: flex;
3627
+ align-items: center;
3628
+ gap: 1rem;
3629
+ font-family: monospace;
3630
+ font-size: 1rem;
3631
+ color: #ffffff;
3632
+ text-decoration: none;
3633
+ transition: background-color 0.2s;
3634
+ }
3635
+
3636
+ .docs-link:hover {
3637
+ background-color: #252525;
3638
+ }
3639
+
3640
+ .arrow-icon {
3641
+ transition: transform 0.2s;
3642
+ }
3643
+
3644
+ .docs-link:hover .arrow-icon {
3645
+ transform: translateX(4px);
3646
+ }
3647
+ </style>
3648
+ </head>
3649
+ <body>
3650
+ <main>
3651
+ <h1>Welcome to the Mastra API</h1>
3652
+ <p class="subtitle">
3653
+ Discover all available endpoints through Swagger UI. You can also define your own <a href="https://mastra.ai/docs/server-db/custom-api-routes" target="_blank" class="link">API routes</a>.
3654
+ </p>
3655
+ <a href="${baseUrl}/swagger-ui" target="_blank" class="docs-link">
3656
+ Browse Swagger UI
3657
+ <svg
3658
+ class="arrow-icon"
3659
+ width="20"
3660
+ height="20"
3661
+ viewBox="0 0 24 24"
3662
+ fill="none"
3663
+ stroke="currentColor"
3664
+ strokeWidth="2"
3665
+ >
3666
+ <path d="M5 12h14M12 5l7 7-7 7" />
3667
+ </svg>
3668
+ </a>
3669
+ </main>
3670
+ </body>
3671
+ </html>
3672
+ `
3673
+ );
3674
+ }
3675
+
3556
3676
  // src/server/welcome.ts
3557
3677
  var html2 = `
3558
3678
  <!doctype html>
@@ -3726,7 +3846,7 @@ async function createHonoServer(mastra, options = {
3726
3846
  tools: options.tools,
3727
3847
  taskStore: a2aTaskStore,
3728
3848
  bodyLimitOptions,
3729
- openapiPath: "/openapi.json",
3849
+ openapiPath: options?.isDev || server?.build?.openAPIDocs ? "/openapi.json" : void 0,
3730
3850
  customRouteAuthConfig
3731
3851
  });
3732
3852
  honoServerAdapter.registerContextMiddleware();
@@ -3763,6 +3883,21 @@ async function createHonoServer(mastra, options = {
3763
3883
  }),
3764
3884
  healthHandler
3765
3885
  );
3886
+ if (options?.isDev || server?.build?.swaggerUI) {
3887
+ app.get(
3888
+ "/api",
3889
+ describeRoute({
3890
+ description: "API Welcome Page",
3891
+ tags: ["system"],
3892
+ responses: {
3893
+ 200: {
3894
+ description: "Success"
3895
+ }
3896
+ }
3897
+ }),
3898
+ rootHandler
3899
+ );
3900
+ }
3766
3901
  honoServerAdapter.registerAuthMiddleware();
3767
3902
  if (server?.middleware) {
3768
3903
  const normalizedMiddlewares = Array.isArray(server.middleware) ? server.middleware : [server.middleware];
@@ -3802,6 +3937,12 @@ async function createHonoServer(mastra, options = {
3802
3937
  }
3803
3938
  await honoServerAdapter.registerRoutes();
3804
3939
  if (options?.isDev || server?.build?.swaggerUI) {
3940
+ if (!options?.isDev && server?.build?.swaggerUI && !server?.build?.openAPIDocs) {
3941
+ const logger2 = mastra.getLogger();
3942
+ logger2.warn(
3943
+ "Swagger UI is enabled but OpenAPI documentation is disabled. The Swagger UI will not function properly without the OpenAPI endpoint. Please enable openAPIDocs in your server.build configuration:\n server: { build: { swaggerUI: true, openAPIDocs: true } }"
3944
+ );
3945
+ }
3805
3946
  app.get(
3806
3947
  "/swagger-ui",
3807
3948
  describeRoute({
@@ -3868,7 +4009,7 @@ async function createHonoServer(mastra, options = {
3868
4009
  }
3869
4010
  app.get("*", async (c, next) => {
3870
4011
  const requestPath = c.req.path;
3871
- if (requestPath.startsWith("/api/") || requestPath.startsWith("/swagger-ui") || requestPath.startsWith("/openapi.json")) {
4012
+ if (requestPath === "/api" || requestPath.startsWith("/api/") || requestPath.startsWith("/swagger-ui") || requestPath.startsWith("/openapi.json")) {
3872
4013
  return await next();
3873
4014
  }
3874
4015
  if (requestPath.includes(".") && !requestPath.endsWith(".html")) {