@mastra/nestjs 0.1.9 → 0.1.10-alpha.1
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 +20 -0
- package/dist/index.cjs +9 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -1
- 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 +2 -0
- package/dist/services/route-handler.service.d.ts.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -11831,7 +11831,8 @@ var RouteHandlerService = class _RouteHandlerService {
|
|
|
11831
11831
|
return {
|
|
11832
11832
|
data,
|
|
11833
11833
|
responseType: route.responseType,
|
|
11834
|
-
streamFormat: route.streamFormat
|
|
11834
|
+
streamFormat: route.streamFormat,
|
|
11835
|
+
sseFlushOnConnect: route.sseFlushOnConnect
|
|
11835
11836
|
};
|
|
11836
11837
|
}
|
|
11837
11838
|
getRouteKey(method, path) {
|
|
@@ -12977,6 +12978,9 @@ var StreamingInterceptor = class _StreamingInterceptor {
|
|
|
12977
12978
|
if (streamFormat === "sse") {
|
|
12978
12979
|
response.setHeader("X-Accel-Buffering", "no");
|
|
12979
12980
|
}
|
|
12981
|
+
if (streamFormat === "sse" && result.sseFlushOnConnect) {
|
|
12982
|
+
response.write(": connected\n\n");
|
|
12983
|
+
}
|
|
12980
12984
|
const data = result.data;
|
|
12981
12985
|
const hasFullStream = data !== null && typeof data === "object" && "fullStream" in data;
|
|
12982
12986
|
const stream = hasFullStream ? data.fullStream : data;
|
|
@@ -12997,6 +13001,10 @@ var StreamingInterceptor = class _StreamingInterceptor {
|
|
|
12997
13001
|
break;
|
|
12998
13002
|
}
|
|
12999
13003
|
if (value) {
|
|
13004
|
+
if (streamFormat === "sse" && typeof value === "string" && value.startsWith(":")) {
|
|
13005
|
+
response.write(value);
|
|
13006
|
+
continue;
|
|
13007
|
+
}
|
|
13000
13008
|
const outputValue = shouldRedact ? redactStreamChunk(value) : value;
|
|
13001
13009
|
if (streamFormat === "sse") {
|
|
13002
13010
|
response.write(`data: ${JSON.stringify(outputValue)}
|