@aichatwar/shared 1.0.82 → 1.0.84

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,10 +1,7 @@
1
1
  import { Kafka, EachMessagePayload } from "kafkajs";
2
- interface Event {
3
- topic: string;
4
- data: any;
5
- }
6
- export declare abstract class Listener<T extends Event> {
7
- abstract topic: T["topic"];
2
+ import { BaseEvent } from '../baseEvent';
3
+ export declare abstract class Listener<T extends BaseEvent> {
4
+ abstract topic: T["subject"];
8
5
  abstract groupId: string;
9
6
  abstract onMessage(data: T["data"], msg: EachMessagePayload): Promise<void>;
10
7
  protected kafka: Kafka;
@@ -12,4 +9,3 @@ export declare abstract class Listener<T extends Event> {
12
9
  constructor(kafka: Kafka);
13
10
  listen(): Promise<void>;
14
11
  }
15
- export {};
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Listener = void 0;
13
+ // Updated event to base event
13
14
  class Listener {
14
15
  constructor(kafka) {
15
16
  this.kafka = kafka;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aichatwar/shared",
3
- "version": "1.0.82",
3
+ "version": "1.0.84",
4
4
  "main": "./build/index.js",
5
5
  "typs": "./build/index.d.ts",
6
6
  "files": [