@heritageai/messaging 1.0.26 → 1.0.28
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/dist/events/notification-created-event.d.ts +12 -0
- package/dist/events/notification-created-event.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/publishers/notification-created-publisher.d.ts +6 -0
- package/dist/publishers/notification-created-publisher.js +12 -0
- package/dist/subjects.d.ts +2 -1
- package/dist/subjects.js +1 -0
- package/dist/types/notifications/notification-type.d.ts +2 -1
- package/dist/types/notifications/notification-type.js +1 -0
- package/package.json +1 -1
- package/src/events/notification-created-event.ts +13 -0
- package/src/index.ts +2 -0
- package/src/publishers/notification-created-publisher.ts +7 -0
- package/src/subjects.ts +1 -0
- package/src/types/notifications/notification-type.ts +1 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Subjects } from "../subjects";
|
|
2
|
+
export interface NotificationCreatedEvent {
|
|
3
|
+
subject: Subjects.NotificationCreated;
|
|
4
|
+
data: {
|
|
5
|
+
id: string;
|
|
6
|
+
userId?: string;
|
|
7
|
+
role?: "admin" | "visitor";
|
|
8
|
+
kind: string;
|
|
9
|
+
message?: string;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from "./events/site-updated-event";
|
|
|
10
10
|
export * from "./events/site-deleted-event";
|
|
11
11
|
export * from "./events/user-created-event";
|
|
12
12
|
export * from "./events/user-deleted-event";
|
|
13
|
+
export * from "./events/notification-created-event";
|
|
13
14
|
export * from "./publishers/asset-created-publisher";
|
|
14
15
|
export * from "./publishers/asset-updated-publisher";
|
|
15
16
|
export * from "./publishers/asset-deleted-publisher";
|
|
@@ -18,6 +19,7 @@ export * from "./publishers/site-updated-publisher";
|
|
|
18
19
|
export * from "./publishers/site-deleted-publisher";
|
|
19
20
|
export * from "./publishers/user-created-publisher";
|
|
20
21
|
export * from "./publishers/user-deleted-publisher";
|
|
22
|
+
export * from "./publishers/notification-created-publisher";
|
|
21
23
|
export * from "./types/notifications/notification-type";
|
|
22
24
|
export * from "./middlewares/verify-ws-jwt";
|
|
23
25
|
export * from "./services/ws-notifier";
|
package/dist/index.js
CHANGED
|
@@ -28,6 +28,7 @@ __exportStar(require("./events/site-updated-event"), exports);
|
|
|
28
28
|
__exportStar(require("./events/site-deleted-event"), exports);
|
|
29
29
|
__exportStar(require("./events/user-created-event"), exports);
|
|
30
30
|
__exportStar(require("./events/user-deleted-event"), exports);
|
|
31
|
+
__exportStar(require("./events/notification-created-event"), exports);
|
|
31
32
|
// publishers
|
|
32
33
|
__exportStar(require("./publishers/asset-created-publisher"), exports);
|
|
33
34
|
__exportStar(require("./publishers/asset-updated-publisher"), exports);
|
|
@@ -37,6 +38,7 @@ __exportStar(require("./publishers/site-updated-publisher"), exports);
|
|
|
37
38
|
__exportStar(require("./publishers/site-deleted-publisher"), exports);
|
|
38
39
|
__exportStar(require("./publishers/user-created-publisher"), exports);
|
|
39
40
|
__exportStar(require("./publishers/user-deleted-publisher"), exports);
|
|
41
|
+
__exportStar(require("./publishers/notification-created-publisher"), exports);
|
|
40
42
|
// types
|
|
41
43
|
__exportStar(require("./types/notifications/notification-type"), exports);
|
|
42
44
|
// middlewares
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BasePublisher } from "../base-publisher";
|
|
2
|
+
import { NotificationCreatedEvent } from "../events/notification-created-event";
|
|
3
|
+
import { Subjects } from "../subjects";
|
|
4
|
+
export declare class NotificationCreatedPublisher extends BasePublisher<NotificationCreatedEvent> {
|
|
5
|
+
subject: Subjects.NotificationCreated;
|
|
6
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationCreatedPublisher = void 0;
|
|
4
|
+
const base_publisher_1 = require("../base-publisher");
|
|
5
|
+
const subjects_1 = require("../subjects");
|
|
6
|
+
class NotificationCreatedPublisher extends base_publisher_1.BasePublisher {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.subject = subjects_1.Subjects.NotificationCreated;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.NotificationCreatedPublisher = NotificationCreatedPublisher;
|
package/dist/subjects.d.ts
CHANGED
package/dist/subjects.js
CHANGED
|
@@ -11,4 +11,5 @@ var NotificationType;
|
|
|
11
11
|
NotificationType["SiteDeleted"] = "site_deleted";
|
|
12
12
|
NotificationType["UserCreated"] = "user_created";
|
|
13
13
|
NotificationType["UserDeleted"] = "user_deleted";
|
|
14
|
+
NotificationType["NotificationCreated"] = "notification_created";
|
|
14
15
|
})(NotificationType || (exports.NotificationType = NotificationType = {}));
|
package/package.json
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Subjects } from "../subjects";
|
|
2
|
+
|
|
3
|
+
export interface NotificationCreatedEvent {
|
|
4
|
+
subject: Subjects.NotificationCreated;
|
|
5
|
+
data: {
|
|
6
|
+
id: string;
|
|
7
|
+
userId?: string;
|
|
8
|
+
role?: "admin" | "visitor";
|
|
9
|
+
kind: string;
|
|
10
|
+
message?: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from "./events/site-updated-event";
|
|
|
14
14
|
export * from "./events/site-deleted-event";
|
|
15
15
|
export * from "./events/user-created-event";
|
|
16
16
|
export * from "./events/user-deleted-event";
|
|
17
|
+
export * from "./events/notification-created-event";
|
|
17
18
|
|
|
18
19
|
// publishers
|
|
19
20
|
export * from "./publishers/asset-created-publisher";
|
|
@@ -24,6 +25,7 @@ export * from "./publishers/site-updated-publisher";
|
|
|
24
25
|
export * from "./publishers/site-deleted-publisher";
|
|
25
26
|
export * from "./publishers/user-created-publisher";
|
|
26
27
|
export * from "./publishers/user-deleted-publisher";
|
|
28
|
+
export * from "./publishers/notification-created-publisher";
|
|
27
29
|
|
|
28
30
|
// types
|
|
29
31
|
export * from "./types/notifications/notification-type";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BasePublisher } from "../base-publisher";
|
|
2
|
+
import { NotificationCreatedEvent } from "../events/notification-created-event";
|
|
3
|
+
import { Subjects } from "../subjects";
|
|
4
|
+
|
|
5
|
+
export class NotificationCreatedPublisher extends BasePublisher<NotificationCreatedEvent> {
|
|
6
|
+
subject: Subjects.NotificationCreated = Subjects.NotificationCreated;
|
|
7
|
+
}
|
package/src/subjects.ts
CHANGED