@tsed/sse 8.33.0 → 8.35.0
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { StoreSet, useDecorators } from "@tsed/core";
|
|
2
|
-
import { Use } from "@tsed/platform-middlewares";
|
|
3
1
|
import { AcceptMime, Header } from "@tsed/schema";
|
|
2
|
+
import { StoreSet, useDecorators } from "@tsed/core";
|
|
4
3
|
import { EventStreamMiddleware } from "../middlewares/EventStreamMiddleware.js";
|
|
4
|
+
import { Use } from "@tsed/platform-middlewares";
|
|
5
5
|
export function EventStream(opts = {}) {
|
|
6
6
|
return useDecorators(StoreSet(EventStreamMiddleware, opts), Use(EventStreamMiddleware), AcceptMime("text/event-stream"), Header("Content-Type", "text/event-stream"));
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { InjectContext, Injectable } from "@tsed/di";
|
|
2
3
|
import { isObservable, isStream } from "@tsed/core";
|
|
3
|
-
import { Injectable, InjectContext } from "@tsed/di";
|
|
4
4
|
let EventStreamInterceptor = class EventStreamInterceptor {
|
|
5
5
|
async intercept(context) {
|
|
6
6
|
const result = await context.next();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var EventStreamMiddleware_1;
|
|
2
2
|
import { __decorate, __metadata, __param } from "tslib";
|
|
3
|
-
import { PlatformContext } from "@tsed/platform-http";
|
|
4
|
-
import { Middleware } from "@tsed/platform-middlewares";
|
|
5
3
|
import { Context } from "@tsed/platform-params";
|
|
6
4
|
import { EventStreamContext } from "../domain/EventStreamContext.js";
|
|
5
|
+
import { Middleware } from "@tsed/platform-middlewares";
|
|
6
|
+
import { PlatformContext } from "@tsed/platform-http";
|
|
7
7
|
let EventStreamMiddleware = EventStreamMiddleware_1 = class EventStreamMiddleware {
|
|
8
8
|
use($ctx) {
|
|
9
9
|
const opts = $ctx.endpoint.store.get(EventStreamMiddleware_1, {});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PlatformContext } from "@tsed/platform-http";
|
|
2
1
|
import type { EventEmitter } from "events";
|
|
3
|
-
import type { Observable } from "rxjs";
|
|
4
2
|
import type { EventStreamOpts } from "../decorators/eventStream.js";
|
|
3
|
+
import type { Observable } from "rxjs";
|
|
4
|
+
import { PlatformContext } from "@tsed/platform-http";
|
|
5
5
|
export type EventStreamContextOptions = {
|
|
6
6
|
$ctx: PlatformContext;
|
|
7
7
|
} & EventStreamOpts;
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/sse",
|
|
3
|
+
"version": "8.35.0",
|
|
3
4
|
"description": "Server-sent events package for Ts.ED framework",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"version": "8.33.0",
|
|
6
5
|
"keywords": [
|
|
7
|
-
"
|
|
6
|
+
"realtime",
|
|
7
|
+
"server",
|
|
8
8
|
"server-sent events",
|
|
9
9
|
"sse",
|
|
10
|
-
"
|
|
11
|
-
"realtime"
|
|
10
|
+
"tsed"
|
|
12
11
|
],
|
|
13
12
|
"source": "./src/index.ts",
|
|
13
|
+
"type": "module",
|
|
14
14
|
"main": "./lib/esm/index.js",
|
|
15
15
|
"module": "./lib/esm/index.js",
|
|
16
16
|
"typings": "./lib/types/index.d.ts",
|
|
@@ -34,17 +34,16 @@
|
|
|
34
34
|
"tslib": ">=2.7.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@tsed/barrels": "8.
|
|
38
|
-
"@tsed/core": "8.
|
|
39
|
-
"@tsed/di": "8.
|
|
40
|
-
"@tsed/json-mapper": "8.
|
|
41
|
-
"@tsed/openspec": "8.
|
|
42
|
-
"@tsed/platform-http": "8.
|
|
43
|
-
"@tsed/platform-middlewares": "8.
|
|
44
|
-
"@tsed/schema": "8.
|
|
45
|
-
"@tsed/socketio-testing": "8.
|
|
46
|
-
"@tsed/typescript": "8.
|
|
47
|
-
"eslint": "9.12.0",
|
|
37
|
+
"@tsed/barrels": "8.35.0",
|
|
38
|
+
"@tsed/core": "8.35.0",
|
|
39
|
+
"@tsed/di": "8.35.0",
|
|
40
|
+
"@tsed/json-mapper": "8.35.0",
|
|
41
|
+
"@tsed/openspec": "8.35.0",
|
|
42
|
+
"@tsed/platform-http": "8.35.0",
|
|
43
|
+
"@tsed/platform-middlewares": "8.35.0",
|
|
44
|
+
"@tsed/schema": "8.35.0",
|
|
45
|
+
"@tsed/socketio-testing": "8.35.0",
|
|
46
|
+
"@tsed/typescript": "8.35.0",
|
|
48
47
|
"express": "^5.2.1",
|
|
49
48
|
"typescript": "6.0.2",
|
|
50
49
|
"vitest": "4.1.4"
|