@mastra/elysia 0.0.0-knowledgev2-20260828164436
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 +119 -0
- package/LICENSE.md +32 -0
- package/dist/__tests__/helpers.d.ts +12 -0
- package/dist/__tests__/helpers.d.ts.map +1 -0
- package/dist/auth-middleware.d.ts +7 -0
- package/dist/auth-middleware.d.ts.map +1 -0
- package/dist/helper.d.ts +60 -0
- package/dist/helper.d.ts.map +1 -0
- package/dist/index.cjs +822 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +818 -0
- package/dist/index.js.map +1 -0
- package/package.json +76 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# @mastra/elysia
|
|
2
|
+
|
|
3
|
+
## 0.0.0-knowledgev2-20260828164436
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`bae1502`](https://github.com/mastra-ai/mastra/commit/bae150254b06a4da6964d7c137af97f336362359), [`457c424`](https://github.com/mastra-ai/mastra/commit/457c424e60c0c0ae66a49c8db6b348840cc8c98d), [`0885364`](https://github.com/mastra-ai/mastra/commit/0885364c2fc7fa31febcfc444fc1ba5231ac1257), [`078affd`](https://github.com/mastra-ai/mastra/commit/078affdaea57ac5e95a77e9e7b197d1878190684), [`9e3403e`](https://github.com/mastra-ai/mastra/commit/9e3403e9868240cb18841898e84cf008ebd7a87e), [`791bf5e`](https://github.com/mastra-ai/mastra/commit/791bf5e81cd27e2e1cff66122f1380ab8a3dda41)]:
|
|
8
|
+
- @mastra/core@0.0.0-knowledgev2-20260828164436
|
|
9
|
+
- @mastra/server@0.0.0-knowledgev2-20260828164436
|
|
10
|
+
|
|
11
|
+
## 0.1.2-alpha.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`078affd`](https://github.com/mastra-ai/mastra/commit/078affdaea57ac5e95a77e9e7b197d1878190684), [`9e3403e`](https://github.com/mastra-ai/mastra/commit/9e3403e9868240cb18841898e84cf008ebd7a87e), [`791bf5e`](https://github.com/mastra-ai/mastra/commit/791bf5e81cd27e2e1cff66122f1380ab8a3dda41)]:
|
|
16
|
+
- @mastra/core@1.63.1-alpha.1
|
|
17
|
+
- @mastra/server@1.63.1-alpha.1
|
|
18
|
+
|
|
19
|
+
## 0.1.2-alpha.0
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [[`bae1502`](https://github.com/mastra-ai/mastra/commit/bae150254b06a4da6964d7c137af97f336362359)]:
|
|
24
|
+
- @mastra/core@1.63.1-alpha.0
|
|
25
|
+
- @mastra/server@1.63.1-alpha.0
|
|
26
|
+
|
|
27
|
+
## 0.1.1
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [[`7176362`](https://github.com/mastra-ai/mastra/commit/717636281a3339911a05ea2cc8ae38afe4fd2cef), [`9045b8f`](https://github.com/mastra-ai/mastra/commit/9045b8fdf622e1d735b96ddd6500bd32556636d9), [`7677a2c`](https://github.com/mastra-ai/mastra/commit/7677a2cd47729221ca28afc5067d26e22d925b59), [`e3b796d`](https://github.com/mastra-ai/mastra/commit/e3b796d29a63f0d5c97dd815aadec40687346d70), [`f7a7467`](https://github.com/mastra-ai/mastra/commit/f7a74678193921e7ea4790232d707b3237626cac), [`49ccd14`](https://github.com/mastra-ai/mastra/commit/49ccd142268a61fb55ea75bc76287643a21f3677), [`f9c56f3`](https://github.com/mastra-ai/mastra/commit/f9c56f336ee8c250763a438990f8e60a428353c9), [`3855b38`](https://github.com/mastra-ai/mastra/commit/3855b38c4c25af32ab8e298e148becc963abe92c)]:
|
|
32
|
+
- @mastra/core@1.63.0
|
|
33
|
+
- @mastra/server@1.63.0
|
|
34
|
+
|
|
35
|
+
## 0.1.1-alpha.1
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- Updated dependencies [[`7677a2c`](https://github.com/mastra-ai/mastra/commit/7677a2cd47729221ca28afc5067d26e22d925b59), [`f7a7467`](https://github.com/mastra-ai/mastra/commit/f7a74678193921e7ea4790232d707b3237626cac), [`f9c56f3`](https://github.com/mastra-ai/mastra/commit/f9c56f336ee8c250763a438990f8e60a428353c9)]:
|
|
40
|
+
- @mastra/core@1.63.0-alpha.1
|
|
41
|
+
- @mastra/server@1.63.0-alpha.1
|
|
42
|
+
|
|
43
|
+
## 0.1.1-alpha.0
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- Updated dependencies [[`7176362`](https://github.com/mastra-ai/mastra/commit/717636281a3339911a05ea2cc8ae38afe4fd2cef), [`e3b796d`](https://github.com/mastra-ai/mastra/commit/e3b796d29a63f0d5c97dd815aadec40687346d70), [`49ccd14`](https://github.com/mastra-ai/mastra/commit/49ccd142268a61fb55ea75bc76287643a21f3677), [`3855b38`](https://github.com/mastra-ai/mastra/commit/3855b38c4c25af32ab8e298e148becc963abe92c)]:
|
|
48
|
+
- @mastra/core@1.63.0-alpha.0
|
|
49
|
+
- @mastra/server@1.63.0-alpha.0
|
|
50
|
+
|
|
51
|
+
## 0.1.0
|
|
52
|
+
|
|
53
|
+
### Minor Changes
|
|
54
|
+
|
|
55
|
+
- Added an Elysia server adapter. Use the new @mastra/elysia package to run a Mastra server inside an Elysia app. ([#22274](https://github.com/mastra-ai/mastra/pull/22274))
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import { Elysia } from 'elysia';
|
|
59
|
+
import { MastraServer } from '@mastra/elysia';
|
|
60
|
+
import { mastra } from './mastra';
|
|
61
|
+
|
|
62
|
+
const app = new Elysia();
|
|
63
|
+
const server = new MastraServer({ app, mastra });
|
|
64
|
+
|
|
65
|
+
await server.init();
|
|
66
|
+
|
|
67
|
+
app.listen(4111);
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Patch Changes
|
|
71
|
+
|
|
72
|
+
- Added the `convertCustomRoutesToOpenAPIPaths` export to `@mastra/server/server-adapter` so server adapters can include custom API routes in generated OpenAPI documents. ([#22274](https://github.com/mastra-ai/mastra/pull/22274))
|
|
73
|
+
|
|
74
|
+
- Updated dependencies [[`79f04a7`](https://github.com/mastra-ai/mastra/commit/79f04a7f6c6829da541139f638f2f1d267916e08), [`65edab1`](https://github.com/mastra-ai/mastra/commit/65edab1c233d17b8f163bad12fca410d0e6f16b1), [`1e47b75`](https://github.com/mastra-ai/mastra/commit/1e47b7520cab4cfaa8daed52f17e2e6d14ff7539), [`ab20a38`](https://github.com/mastra-ai/mastra/commit/ab20a38d0275f8d85e0f3833bd87ef487bcc609f), [`fd4d5fe`](https://github.com/mastra-ai/mastra/commit/fd4d5fe4f943699b85db5e74404f190d5a6b8c2a), [`ae8790c`](https://github.com/mastra-ai/mastra/commit/ae8790c4bfaa088d2ab279d1dcc06f326b9fd109), [`2c85f42`](https://github.com/mastra-ai/mastra/commit/2c85f428e04ccd63ea31a7ec80b5b327afdad555), [`11bbeb9`](https://github.com/mastra-ai/mastra/commit/11bbeb9b108ef2264e05acefc6dafb9cbb342921), [`48ef1f1`](https://github.com/mastra-ai/mastra/commit/48ef1f1d24eedafbb07f64e659a81b52b67b8bf6), [`aa3a85d`](https://github.com/mastra-ai/mastra/commit/aa3a85daf094c683bb97efdf4b6a696d2e474af5), [`d29d06f`](https://github.com/mastra-ai/mastra/commit/d29d06fe00bbd35b4571150ea04c59d2ed783c71), [`e6516df`](https://github.com/mastra-ai/mastra/commit/e6516dfcdae4f4ac0e7971d84359a81385ee602f), [`1a485f3`](https://github.com/mastra-ai/mastra/commit/1a485f3538f5ec64d58bd8b5e1e99de0c695c87b), [`0d37487`](https://github.com/mastra-ai/mastra/commit/0d37487d9f349388a3f1cef6a536cf9dcc4b6273), [`8661d7d`](https://github.com/mastra-ai/mastra/commit/8661d7d7179f0a024456aabdd8679bcecd09ac28), [`dbbfeb8`](https://github.com/mastra-ai/mastra/commit/dbbfeb85ec949dc9ebc0755e1ad262e4f5eba8db), [`575e343`](https://github.com/mastra-ai/mastra/commit/575e343900451021d96110916497d334af7bc252), [`63041eb`](https://github.com/mastra-ai/mastra/commit/63041eb4c50b520a0a80e03d4cd6ea99f67715a0), [`0b2a3d1`](https://github.com/mastra-ai/mastra/commit/0b2a3d1783875c5b97b7b36ab3d03d7360e0dde7), [`6bb5d71`](https://github.com/mastra-ai/mastra/commit/6bb5d7193fe9166b219f0fccae17db7a5ae86e65), [`3cc9d00`](https://github.com/mastra-ai/mastra/commit/3cc9d00b2b4333e0377a5e9df5eff92c17ce7630), [`cacb839`](https://github.com/mastra-ai/mastra/commit/cacb8392d9e74189b56d857290b0615f98a2683d), [`57de7d6`](https://github.com/mastra-ai/mastra/commit/57de7d644ba7146edb4e9e6111ec4fa98c3a59e9), [`c8e4cea`](https://github.com/mastra-ai/mastra/commit/c8e4ceac9a390d78c8327dff3cdb2861dd71957f), [`ed01e9a`](https://github.com/mastra-ai/mastra/commit/ed01e9a807514a904374bf687a7b8f18750f6f78), [`b47b26e`](https://github.com/mastra-ai/mastra/commit/b47b26e6fe95cb8a3482be2c5e52de157fe59d0b), [`0d37487`](https://github.com/mastra-ai/mastra/commit/0d37487d9f349388a3f1cef6a536cf9dcc4b6273), [`733a537`](https://github.com/mastra-ai/mastra/commit/733a537489a858b5880b2e98809334fba895a221), [`e8e299c`](https://github.com/mastra-ai/mastra/commit/e8e299cc6abdfc39947e2fec25803493015d3882), [`edfc548`](https://github.com/mastra-ai/mastra/commit/edfc548886bc7bae17b681f8b6b41a47eb32bcd2), [`b05f486`](https://github.com/mastra-ai/mastra/commit/b05f48612984d5fe2447ea2d6cdd5c604d285b97), [`a8a4871`](https://github.com/mastra-ai/mastra/commit/a8a4871215f51da95c47129602157ce5372f634a), [`eb9ecaa`](https://github.com/mastra-ai/mastra/commit/eb9ecaa89c36e889749e3b825cfc507ce7f7980b), [`4ff3ee2`](https://github.com/mastra-ai/mastra/commit/4ff3ee2bff7ed07528b4817f8f49639031c72a4d), [`9207dfa`](https://github.com/mastra-ai/mastra/commit/9207dfab8062e5fc68b751684797ff86fe0b4e70), [`5165cdc`](https://github.com/mastra-ai/mastra/commit/5165cdcdcf50e144bb8113278535196cc9b07065), [`e737014`](https://github.com/mastra-ai/mastra/commit/e737014e0fc7035759762bb5b48baef1d6c0f6a7), [`6bb5d71`](https://github.com/mastra-ai/mastra/commit/6bb5d7193fe9166b219f0fccae17db7a5ae86e65), [`f591643`](https://github.com/mastra-ai/mastra/commit/f591643becdf0be9bddce6ba1748e64bc30d77f1), [`63796ba`](https://github.com/mastra-ai/mastra/commit/63796ba0fda60253be17535e68f6bbbf1e6ffa09), [`b1ad324`](https://github.com/mastra-ai/mastra/commit/b1ad324d657f3544b0701332aef7eb10e9a36258), [`61c566d`](https://github.com/mastra-ai/mastra/commit/61c566dd2f2cde2b23ed8f139924e530d4202214), [`c24754c`](https://github.com/mastra-ai/mastra/commit/c24754c1fb6fe144e5051e536e98c8a18b0214ac), [`12c61d2`](https://github.com/mastra-ai/mastra/commit/12c61d280c8cb208bc3c8dbcbe5dcc60cf9d1cd0), [`c46eb09`](https://github.com/mastra-ai/mastra/commit/c46eb09ce4987509af57a0ac582c61241a6dd2f1), [`9ee8120`](https://github.com/mastra-ai/mastra/commit/9ee8120ce17f76b9f617489e05a283353742690a), [`d975e92`](https://github.com/mastra-ai/mastra/commit/d975e924d4936f46c386bd3dee39c671720289f6), [`45dd6ee`](https://github.com/mastra-ai/mastra/commit/45dd6ee089bd7df0d0c98a10098e483fd388e04a), [`4e9a228`](https://github.com/mastra-ai/mastra/commit/4e9a2283d5fd6ed1b70a2751eb3dc2cbf82ada20), [`d6ce34a`](https://github.com/mastra-ai/mastra/commit/d6ce34aeceb06ddf3d595a1eed5cc74f481a46a1), [`f95f468`](https://github.com/mastra-ai/mastra/commit/f95f468cf1e7c2b924a13826494f98b8f2ccd581), [`30ed33e`](https://github.com/mastra-ai/mastra/commit/30ed33ee14084a26019aba15fceadda6d6ddefaf), [`04a815f`](https://github.com/mastra-ai/mastra/commit/04a815fc8971d29e97fcdcc5008a1eb472fc00ff), [`1cfa878`](https://github.com/mastra-ai/mastra/commit/1cfa8784d8da0dfaa0317e5048bc48b6084a5ea5), [`9a12ef3`](https://github.com/mastra-ai/mastra/commit/9a12ef3fccf3f4186db0f294f4ee1f02cf4d8db2), [`32d3583`](https://github.com/mastra-ai/mastra/commit/32d358332cb8ac2306b83b73cf3536e74dbd435e), [`7960688`](https://github.com/mastra-ai/mastra/commit/7960688828e04eaf3106e34f7758fa580257eef6), [`91ad69d`](https://github.com/mastra-ai/mastra/commit/91ad69d64994c89199b0c55399e64ed91c61df2f), [`8dc408d`](https://github.com/mastra-ai/mastra/commit/8dc408d34438f9e13297f792c11a5cfd6cf952e1), [`c92def1`](https://github.com/mastra-ai/mastra/commit/c92def10a13c822972c96f0a4ca6ffc1f4258aed), [`63041eb`](https://github.com/mastra-ai/mastra/commit/63041eb4c50b520a0a80e03d4cd6ea99f67715a0), [`2848a9f`](https://github.com/mastra-ai/mastra/commit/2848a9f4c89fa03c34e94793929d14640117d5f6), [`c118318`](https://github.com/mastra-ai/mastra/commit/c1183181c9804303db4b511c2e2648f8b714712b), [`c5eaec5`](https://github.com/mastra-ai/mastra/commit/c5eaec5a860d80d0e3805e67db0414b87ac8cbed), [`fc07c64`](https://github.com/mastra-ai/mastra/commit/fc07c6465043e08e99193a6751a01c56ffc2e7a1), [`cced745`](https://github.com/mastra-ai/mastra/commit/cced745a056ec2225c5bc702e32d848847aa8b65), [`542dee2`](https://github.com/mastra-ai/mastra/commit/542dee254167f974ff8cbbbfc0ce10f9a2616a7b), [`3c19dce`](https://github.com/mastra-ai/mastra/commit/3c19dcef8e73062a80627a4927eae3ec11145afd), [`aca2869`](https://github.com/mastra-ai/mastra/commit/aca2869b2031982f3c4a2f52525c9be7cf123ef8), [`2848a9f`](https://github.com/mastra-ai/mastra/commit/2848a9f4c89fa03c34e94793929d14640117d5f6), [`a58483c`](https://github.com/mastra-ai/mastra/commit/a58483cff1a9d41fce7c931843f48cb0ac450f64), [`a58483c`](https://github.com/mastra-ai/mastra/commit/a58483cff1a9d41fce7c931843f48cb0ac450f64), [`e6f8450`](https://github.com/mastra-ai/mastra/commit/e6f845074d478527026b18d85031b23353e1d0a4), [`895e9df`](https://github.com/mastra-ai/mastra/commit/895e9dfc17d6f34299eca64e317ded9e5f5e5ef8), [`e66b2ba`](https://github.com/mastra-ai/mastra/commit/e66b2ba100db63eaeab6e21e1ea34b113f2ec781), [`3e8727e`](https://github.com/mastra-ai/mastra/commit/3e8727e11ec1a5d733acedb5c872896394be18c1)]:
|
|
75
|
+
- @mastra/core@1.62.0
|
|
76
|
+
- @mastra/server@1.62.0
|
|
77
|
+
|
|
78
|
+
## 0.1.0-alpha.2
|
|
79
|
+
|
|
80
|
+
### Patch Changes
|
|
81
|
+
|
|
82
|
+
- Updated dependencies [[`48ef1f1`](https://github.com/mastra-ai/mastra/commit/48ef1f1d24eedafbb07f64e659a81b52b67b8bf6), [`63796ba`](https://github.com/mastra-ai/mastra/commit/63796ba0fda60253be17535e68f6bbbf1e6ffa09), [`3c19dce`](https://github.com/mastra-ai/mastra/commit/3c19dcef8e73062a80627a4927eae3ec11145afd)]:
|
|
83
|
+
- @mastra/core@1.62.0-alpha.12
|
|
84
|
+
- @mastra/server@1.62.0-alpha.12
|
|
85
|
+
|
|
86
|
+
## 0.1.0-alpha.1
|
|
87
|
+
|
|
88
|
+
### Patch Changes
|
|
89
|
+
|
|
90
|
+
- Updated dependencies [[`4ff3ee2`](https://github.com/mastra-ai/mastra/commit/4ff3ee2bff7ed07528b4817f8f49639031c72a4d), [`c24754c`](https://github.com/mastra-ai/mastra/commit/c24754c1fb6fe144e5051e536e98c8a18b0214ac), [`45dd6ee`](https://github.com/mastra-ai/mastra/commit/45dd6ee089bd7df0d0c98a10098e483fd388e04a), [`32d3583`](https://github.com/mastra-ai/mastra/commit/32d358332cb8ac2306b83b73cf3536e74dbd435e), [`aca2869`](https://github.com/mastra-ai/mastra/commit/aca2869b2031982f3c4a2f52525c9be7cf123ef8)]:
|
|
91
|
+
- @mastra/core@1.62.0-alpha.11
|
|
92
|
+
- @mastra/server@1.62.0-alpha.11
|
|
93
|
+
|
|
94
|
+
## 0.1.0-alpha.0
|
|
95
|
+
|
|
96
|
+
### Minor Changes
|
|
97
|
+
|
|
98
|
+
- Added an Elysia server adapter. Use the new @mastra/elysia package to run a Mastra server inside an Elysia app. ([#22274](https://github.com/mastra-ai/mastra/pull/22274))
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
import { Elysia } from 'elysia';
|
|
102
|
+
import { MastraServer } from '@mastra/elysia';
|
|
103
|
+
import { mastra } from './mastra';
|
|
104
|
+
|
|
105
|
+
const app = new Elysia();
|
|
106
|
+
const server = new MastraServer({ app, mastra });
|
|
107
|
+
|
|
108
|
+
await server.init();
|
|
109
|
+
|
|
110
|
+
app.listen(4111);
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Patch Changes
|
|
114
|
+
|
|
115
|
+
- Added the `convertCustomRoutesToOpenAPIPaths` export to `@mastra/server/server-adapter` so server adapters can include custom API routes in generated OpenAPI documents. ([#22274](https://github.com/mastra-ai/mastra/pull/22274))
|
|
116
|
+
|
|
117
|
+
- Updated dependencies [[`b05f486`](https://github.com/mastra-ai/mastra/commit/b05f48612984d5fe2447ea2d6cdd5c604d285b97), [`7960688`](https://github.com/mastra-ai/mastra/commit/7960688828e04eaf3106e34f7758fa580257eef6), [`2848a9f`](https://github.com/mastra-ai/mastra/commit/2848a9f4c89fa03c34e94793929d14640117d5f6), [`2848a9f`](https://github.com/mastra-ai/mastra/commit/2848a9f4c89fa03c34e94793929d14640117d5f6)]:
|
|
118
|
+
- @mastra/core@1.62.0-alpha.10
|
|
119
|
+
- @mastra/server@1.62.0-alpha.10
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Portions of this software are licensed as follows:
|
|
2
|
+
|
|
3
|
+
- All content that resides under any directory named `ee/` within this
|
|
4
|
+
repository, including but not limited to:
|
|
5
|
+
- `@mastra/core/auth/ee`
|
|
6
|
+
- `@mastra/core/agent-builder/ee`
|
|
7
|
+
- `@mastra/editor/ee`
|
|
8
|
+
|
|
9
|
+
is licensed under the license defined in [`ee/LICENSE`](https://github.com/mastra-ai/mastra/blob/main/ee/LICENSE).
|
|
10
|
+
|
|
11
|
+
- All third-party components incorporated into the Mastra Software are
|
|
12
|
+
licensed under the original license provided by the owner of the
|
|
13
|
+
applicable component.
|
|
14
|
+
|
|
15
|
+
- Content outside of the above-mentioned directories or restrictions is
|
|
16
|
+
available under the "Apache License 2.0" as defined below.
|
|
17
|
+
|
|
18
|
+
# Apache License 2.0
|
|
19
|
+
|
|
20
|
+
Copyright (c) 2025 Kepler Software, Inc.
|
|
21
|
+
|
|
22
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
23
|
+
you may not use this file except in compliance with the License.
|
|
24
|
+
You may obtain a copy of the License at
|
|
25
|
+
|
|
26
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
27
|
+
|
|
28
|
+
Unless required by applicable law or agreed to in writing, software
|
|
29
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
30
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
31
|
+
See the License for the specific language governing permissions and
|
|
32
|
+
limitations under the License.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Server } from 'node:http';
|
|
2
|
+
import type Elysia from 'elysia';
|
|
3
|
+
/**
|
|
4
|
+
* Starts a real Node HTTP server that delegates requests to an Elysia app's fetch method.
|
|
5
|
+
* This is needed for tests that use `fetch()` directly (multipart, OpenAPI, custom routes, MCP transport).
|
|
6
|
+
*/
|
|
7
|
+
export declare function startElysiaServer(app: Elysia): Promise<{
|
|
8
|
+
baseUrl: string;
|
|
9
|
+
cleanup: () => Promise<void>;
|
|
10
|
+
server: Server;
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/__tests__/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAuB,MAAM,EAAE,MAAM,WAAW,CAAC;AAE7D,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5D,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAiFD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Mastra } from '@mastra/core/mastra';
|
|
2
|
+
export interface ElysiaAuthMiddlewareOptions {
|
|
3
|
+
mastra: Mastra;
|
|
4
|
+
requiresAuth?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function createAuthMiddleware({ mastra, requiresAuth, }: ElysiaAuthMiddlewareOptions): (ctx: any) => Promise<globalThis.Response | void>;
|
|
7
|
+
//# sourceMappingURL=auth-middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-middleware.d.ts","sourceRoot":"","sources":["../src/auth-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAIlD,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,YAAmB,GACpB,EAAE,2BAA2B,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC,CA8CjF"}
|
package/dist/helper.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { MastraServer } from './index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get OpenAPI documentation from a MastraServer instance, formatted for Elysia's openapi plugin.
|
|
4
|
+
*
|
|
5
|
+
* This function:
|
|
6
|
+
* - Extracts all Mastra routes with their Zod schemas
|
|
7
|
+
* - Converts them to OpenAPI 3.1.0 format
|
|
8
|
+
* - Merges custom routes if registered
|
|
9
|
+
* - Applies the configured route prefix to all paths
|
|
10
|
+
* - Caches the result for performance
|
|
11
|
+
*
|
|
12
|
+
* @param server - The MastraServer instance (must be initialized with init())
|
|
13
|
+
* @param options - Optional configuration for OpenAPI metadata
|
|
14
|
+
* @returns OpenAPI documentation with paths, components, and info
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import { getMastraOpenAPIDoc } from '@mastra/elysia';
|
|
19
|
+
*
|
|
20
|
+
* const srv = new MastraServer({ mastra, app, prefix: '/api' });
|
|
21
|
+
* await srv.init();
|
|
22
|
+
*
|
|
23
|
+
* const openAPIDoc = getMastraOpenAPIDoc(srv, {
|
|
24
|
+
* title: 'My Mastra API',
|
|
25
|
+
* version: '1.0.0',
|
|
26
|
+
* description: 'API with weather agent'
|
|
27
|
+
* });
|
|
28
|
+
*
|
|
29
|
+
* app.use(openapi({
|
|
30
|
+
* documentation: {
|
|
31
|
+
* info: openAPIDoc.info,
|
|
32
|
+
* paths: openAPIDoc.paths,
|
|
33
|
+
* components: openAPIDoc.components
|
|
34
|
+
* }
|
|
35
|
+
* }));
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function getMastraOpenAPIDoc(server: MastraServer, options?: {
|
|
39
|
+
title?: string;
|
|
40
|
+
version?: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
clearCache?: boolean;
|
|
43
|
+
}): {
|
|
44
|
+
paths: Record<string, any>;
|
|
45
|
+
components?: Record<string, any>;
|
|
46
|
+
info: {
|
|
47
|
+
title: string;
|
|
48
|
+
version: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Clear the OpenAPI documentation cache.
|
|
54
|
+
* Call this if routes are added dynamically after initialization.
|
|
55
|
+
*
|
|
56
|
+
* `@param` server - The MastraServer instance to clear cache for.
|
|
57
|
+
* Note: WeakMap does not support clearing all entries. Pass the specific server instance whose cache should be invalidated.
|
|
58
|
+
*/
|
|
59
|
+
export declare function clearMastraOpenAPICache(server?: MastraServer): void;
|
|
60
|
+
//# sourceMappingURL=helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAe5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE;IACR,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GACA;IACD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAChE,CA8DA;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,IAAI,CAKnE"}
|