@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.
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
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;
@@ -6,5 +6,6 @@ export declare enum Subjects {
6
6
  SiteUpdated = "site:updated",
7
7
  SiteDeleted = "site:deleted",
8
8
  UserCreated = "user:created",
9
- UserDeleted = "user:deleted"
9
+ UserDeleted = "user:deleted",
10
+ NotificationCreated = "notification:created"
10
11
  }
package/dist/subjects.js CHANGED
@@ -11,4 +11,5 @@ var Subjects;
11
11
  Subjects["SiteDeleted"] = "site:deleted";
12
12
  Subjects["UserCreated"] = "user:created";
13
13
  Subjects["UserDeleted"] = "user:deleted";
14
+ Subjects["NotificationCreated"] = "notification:created";
14
15
  })(Subjects || (exports.Subjects = Subjects = {}));
@@ -6,5 +6,6 @@ export declare enum NotificationType {
6
6
  SiteUpdated = "site_updated",
7
7
  SiteDeleted = "site_deleted",
8
8
  UserCreated = "user_created",
9
- UserDeleted = "user_deleted"
9
+ UserDeleted = "user_deleted",
10
+ NotificationCreated = "notification_created"
10
11
  }
@@ -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
@@ -2,7 +2,7 @@
2
2
  "author": "future_platform",
3
3
  "name": "@heritageai/messaging",
4
4
  "license": "ISC",
5
- "version": "1.0.26",
5
+ "version": "1.0.28",
6
6
  "description": "",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
@@ -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
@@ -7,4 +7,5 @@ export enum Subjects {
7
7
  SiteDeleted = "site:deleted",
8
8
  UserCreated = "user:created",
9
9
  UserDeleted = "user:deleted",
10
+ NotificationCreated = "notification:created",
10
11
  }
@@ -7,4 +7,5 @@ export enum NotificationType {
7
7
  SiteDeleted = "site_deleted",
8
8
  UserCreated = "user_created",
9
9
  UserDeleted = "user_deleted",
10
+ NotificationCreated = "notification_created",
10
11
  }