@dudousxd/nestjs-notifications-sse 0.4.0 → 0.5.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,4 +1,4 @@
|
|
|
1
|
-
import { type Type } from '@nestjs/common';
|
|
1
|
+
import { type CanActivate, type Type } from '@nestjs/common';
|
|
2
2
|
/** Options for {@link createNotificationsStreamController}. */
|
|
3
3
|
export interface NotificationsStreamControllerOptions {
|
|
4
4
|
/**
|
|
@@ -15,6 +15,8 @@ export interface NotificationsStreamControllerOptions {
|
|
|
15
15
|
path?: string;
|
|
16
16
|
/** Sub-path for the `@Sse()` endpoint. Default `'stream'` → `GET {path}/stream`. */
|
|
17
17
|
streamPath?: string;
|
|
18
|
+
/** Guards to protect the stream with (e.g. your auth guard). Applied via `@UseGuards`. */
|
|
19
|
+
guards?: Array<Type<CanActivate> | CanActivate>;
|
|
18
20
|
/**
|
|
19
21
|
* Keep-alive interval (ms) emitting a `{ type: 'heartbeat' }` event so idle connections survive
|
|
20
22
|
* proxy/load-balancer timeouts. Default `25000`; set `0` to disable.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream-controller.d.ts","sourceRoot":"","sources":["../src/stream-controller.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"stream-controller.d.ts","sourceRoot":"","sources":["../src/stream-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAKhB,KAAK,IAAI,EAEV,MAAM,gBAAgB,CAAC;AAKxB,+DAA+D;AAC/D,MAAM,WAAW,oCAAoC;IACnD;;;OAGG;IACH,YAAY,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC/E,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oFAAoF;IACpF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0FAA0F;IAC1F,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC,CAAC;IAChD;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,oCAAoC,GAC5C,IAAI,CAAC,OAAO,CAAC,CA8Bf"}
|
|
@@ -66,6 +66,9 @@ function createNotificationsStreamController(options) {
|
|
|
66
66
|
(0, common_1.Controller)(options.path ?? 'notifications'),
|
|
67
67
|
__metadata("design:paramtypes", [sse_hub_1.SseHub])
|
|
68
68
|
], NotificationsStreamController);
|
|
69
|
+
if (options.guards && options.guards.length > 0) {
|
|
70
|
+
(0, common_1.UseGuards)(...options.guards)(NotificationsStreamController);
|
|
71
|
+
}
|
|
69
72
|
return NotificationsStreamController;
|
|
70
73
|
}
|
|
71
74
|
//# sourceMappingURL=stream-controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream-controller.js","sourceRoot":"","sources":["../src/stream-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"stream-controller.js","sourceRoot":"","sources":["../src/stream-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAwDA,kFAgCC;AAxFD,2CAQwB;AACxB,+BAA8E;AAC9E,uCAAmC;AACnC,uCAAmC;AA2BnC;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,mCAAmC,CACjD,OAA6C;IAE7C,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,MAAM,CAAC;IAElD,IACM,6BAA6B,GADnC,MACM,6BAA6B;QACJ;QAA7B,YAA6B,GAAW;YAAX,QAAG,GAAH,GAA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,IAAA,kBAAS,EAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,6BAA6B,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,6BAA6B,CAAC;AACvC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dudousxd/nestjs-notifications-sse",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Server-Sent Events channel for nestjs-notifications — push real-time notifications over native NestJS SSE",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Davide Carvalho",
|