@mastra/nestjs 0.1.9 → 0.1.10-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 +34 -0
- package/dist/filters/mastra-exception.filter.d.ts.map +1 -1
- package/dist/index.cjs +13 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -16
- package/dist/index.js.map +1 -1
- package/dist/interceptors/streaming.interceptor.d.ts.map +1 -1
- package/dist/services/route-handler.service.d.ts +11 -4
- package/dist/services/route-handler.service.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming.interceptor.d.ts","sourceRoot":"","sources":["../../src/interceptors/streaming.interceptor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAErF,OAAO,EAAE,UAAU,EAAuB,MAAM,MAAM,CAAC;AAGvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D;;;GAGG;AACH,qBACa,oBAAqB,YAAW,eAAe;IAMhC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACvB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAN3D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;IAChE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAgB;gBAGD,OAAO,EAAE,mBAAmB,EAC3B,eAAe,EAAE,eAAe;IAuB5E,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU,CAAC,OAAO,CAAC;IA2B5E;;;OAGG;IACH,OAAO,CAAC,aAAa;YAyBP,cAAc;IAQ5B;;OAEG;YACW,eAAe;
|
|
1
|
+
{"version":3,"file":"streaming.interceptor.d.ts","sourceRoot":"","sources":["../../src/interceptors/streaming.interceptor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAErF,OAAO,EAAE,UAAU,EAAuB,MAAM,MAAM,CAAC;AAGvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D;;;GAGG;AACH,qBACa,oBAAqB,YAAW,eAAe;IAMhC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACvB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAN3D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;IAChE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAgB;gBAGD,OAAO,EAAE,mBAAmB,EAC3B,eAAe,EAAE,eAAe;IAuB5E,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU,CAAC,OAAO,CAAC;IA2B5E;;;OAGG;IACH,OAAO,CAAC,aAAa;YAyBP,cAAc;IAQ5B;;OAEG;YACW,eAAe;IAoF7B;;OAEG;YACW,gBAAgB;IA4B9B;;OAEG;YACW,aAAa;IAuC3B;;OAEG;YACW,YAAY;CA+B3B"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Mastra } from '@mastra/core/mastra';
|
|
2
2
|
import type { RequestContext } from '@mastra/core/request-context';
|
|
3
|
-
import type { ServerRoute } from '@mastra/server/server-adapter';
|
|
4
|
-
import { ZodError } from 'zod';
|
|
3
|
+
import type { ServerRoute, ZodErrorLike } from '@mastra/server/server-adapter';
|
|
5
4
|
import type { MastraModuleOptions } from '../mastra.module.js';
|
|
6
5
|
export interface RouteMatch {
|
|
7
6
|
route: ServerRoute;
|
|
@@ -26,6 +25,8 @@ export interface RouteHandlerResult {
|
|
|
26
25
|
responseType: 'json' | 'stream' | 'datastream-response' | 'mcp-http' | 'mcp-sse';
|
|
27
26
|
/** Stream format (only for 'stream' responseType) */
|
|
28
27
|
streamFormat?: 'sse' | 'stream';
|
|
28
|
+
/** Whether to flush an SSE comment on connect before stream data arrives */
|
|
29
|
+
sseFlushOnConnect?: boolean;
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
32
|
* Service that bridges NestJS controllers to Mastra route handlers.
|
|
@@ -70,9 +71,15 @@ export declare class RouteHandlerService {
|
|
|
70
71
|
}
|
|
71
72
|
/**
|
|
72
73
|
* Error class for validation failures with Zod error details.
|
|
74
|
+
*
|
|
75
|
+
* `zodError` is typed as `ZodErrorLike` (a structural subset of `ZodError`
|
|
76
|
+
* exposing `issues[]`) so that consumers pinning a different `zod` major than
|
|
77
|
+
* the one bundled with this adapter still type-check. The runtime value is
|
|
78
|
+
* the actual `ZodError` thrown by the route schema and supports all of its
|
|
79
|
+
* methods at runtime — cast to your installed `ZodError` if you need them.
|
|
73
80
|
*/
|
|
74
81
|
export declare class ValidationError extends Error {
|
|
75
|
-
readonly zodError:
|
|
76
|
-
constructor(message: string, zodError:
|
|
82
|
+
readonly zodError: ZodErrorLike;
|
|
83
|
+
constructor(message: string, zodError: ZodErrorLike);
|
|
77
84
|
}
|
|
78
85
|
//# sourceMappingURL=route-handler.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-handler.service.d.ts","sourceRoot":"","sources":["../../src/services/route-handler.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"route-handler.service.d.ts","sourceRoot":"","sources":["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CAAC,iBAAiB,CAO/B;gBAGgC,MAAM,EAAE,MAAM,EACN,OAAO,EAAE,mBAAmB;IAUvE;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAKhE;;;;;;;OAOG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IA4B3D;;OAEG;IACH,YAAY,IAAI,SAAS,WAAW,EAAE;IAItC;;;OAGG;IACH,OAAO,CAAC,SAAS;IAsCjB;;OAEG;IACG,cAAc,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA+DjG,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,gBAAgB;CAgBzB;AAED;;;;;;;;GAQG;AACH,qBAAa,eAAgB,SAAQ,KAAK;aAGtB,QAAQ,EAAE,YAAY;gBADtC,OAAO,EAAE,MAAM,EACC,QAAQ,EAAE,YAAY;CAKzC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/nestjs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10-alpha.2",
|
|
4
4
|
"description": "Mastra NestJS adapter for the server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@fastify/busboy": "^3.2.0",
|
|
24
|
-
"@mastra/server": "1.
|
|
24
|
+
"@mastra/server": "1.38.0-alpha.2"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@nestjs/common": "^10.4.15",
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
"zod": "^3.25.0",
|
|
46
46
|
"@internal/server-adapter-test-utils": "0.0.22",
|
|
47
47
|
"@internal/storage-test-utils": "0.0.95",
|
|
48
|
-
"@
|
|
48
|
+
"@mastra/core": "1.38.0-alpha.2",
|
|
49
49
|
"@mastra/evals": "1.2.3",
|
|
50
|
-
"@internal/
|
|
50
|
+
"@internal/types-builder": "0.0.74",
|
|
51
51
|
"@mastra/libsql": "1.11.1",
|
|
52
|
-
"@
|
|
53
|
-
"@mastra/
|
|
54
|
-
"@mastra/
|
|
52
|
+
"@internal/lint": "0.0.99",
|
|
53
|
+
"@mastra/memory": "1.20.1-alpha.0",
|
|
54
|
+
"@mastra/observability": "1.14.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@mastra/core": ">=1.34.0-0 <2.0.0-0",
|