File tree Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 17
17
"scripts" : {
18
18
"lint" : " npx eslint ." ,
19
19
"test" : " npx jest --silent"
20
- }
20
+ },
21
+ "cds" : {
22
+ "requires" : {
23
+ "kinds" : {
24
+ "notifications" : {
25
+ "[development]" : {
26
+ "kind" : " alert-to-console"
27
+ }
28
+ },
29
+ "alert-to-console" : {
30
+ "impl" : " @cap-js/alert-notification/srv/log2console" ,
31
+ "outbox" : false
32
+ }
33
+ }
34
+ }
35
+ }
21
36
}
Original file line number Diff line number Diff line change
1
+ const AlertNotificationService = require ( './service' )
2
+
3
+ module . exports = class Alert2Console extends AlertNotificationService {
4
+ async init ( ) {
5
+
6
+ // call AlertNotificationService's init
7
+ await super . init ( )
8
+ }
9
+ }
Original file line number Diff line number Diff line change 2
2
* TODO: Add the entry point for the Plugin Service here.
3
3
* We will branch out for development and production profile here
4
4
*/
5
+
6
+ const cds = require ( '@sap/cds' )
7
+ const notifier = require ( "../lib/notifications" ) ;
8
+
9
+ // REVISIT: cds.OutboxService or technique to avoid extending OutboxService
10
+ const OutboxService = require ( '@sap/cds/libx/_runtime/messaging/Outbox' )
11
+
12
+ module . exports = class AlertNotificationService extends OutboxService {
13
+ async init ( ) {
14
+
15
+ // call OutboxService's init
16
+ await super . init ( )
17
+
18
+ this . notify = notifier . postNotification
19
+ }
20
+ }
You can’t perform that action at this time.
0 commit comments