docta-package 1.2.12 → 1.2.14

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/build/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export * from "./utils";
9
9
  export * from "./config";
10
10
  export * from "./interfaces";
11
11
  export * from "./enums";
12
+ export * from "./rabbitmq";
12
13
  declare global {
13
14
  namespace Express {
14
15
  interface Request {
package/build/index.js CHANGED
@@ -24,3 +24,4 @@ __exportStar(require("./utils"), exports);
24
24
  __exportStar(require("./config"), exports);
25
25
  __exportStar(require("./interfaces"), exports);
26
26
  __exportStar(require("./enums"), exports);
27
+ __exportStar(require("./rabbitmq"), exports);
@@ -19,7 +19,7 @@ function publishToTopicExchange(_a) {
19
19
  return __awaiter(this, arguments, void 0, function* ({ exchange, routingKey, message, }) {
20
20
  try {
21
21
  // Connect to RabbitMQ server
22
- const connection = yield amqplib_1.default.connect((0, config_1.getGeneralConfig)().rabbitmqHost); // Replace with your RabbitMQ URL
22
+ const connection = yield amqplib_1.default.connect((0, config_1.getGeneralConfig)().rabbitmqHost);
23
23
  const channel = yield connection.createChannel();
24
24
  // Assert the topic exchange exists
25
25
  yield channel.assertExchange(exchange, "topic", { durable: true });
@@ -39,61 +39,3 @@ function publishToTopicExchange(_a) {
39
39
  }
40
40
  });
41
41
  }
42
- // import amqp from "amqplib";
43
- // interface ListenerOptions<T> {
44
- // exchange: string;
45
- // queue: string;
46
- // routingKeys: string[];
47
- // }
48
- // export async function listenToQueue<T>({
49
- // exchange,
50
- // queue,
51
- // routingKeys,
52
- // }: ListenerOptions<T>) {
53
- // try {
54
- // const connection = await amqp.connect("amqp://localhost");
55
- // const channel = await connection.createChannel();
56
- // await channel.assertExchange(exchange, "topic", { durable: true });
57
- // await channel.assertQueue(queue, { durable: true });
58
- // // Bind queue to each routing key
59
- // for (const key of routingKeys) {
60
- // await channel.bindQueue(queue, exchange, key);
61
- // console.log(`✅ Bound queue "${queue}" to routing key "${key}"`);
62
- // }
63
- // console.log(
64
- // `🎧 Listening on "${queue}" for routing keys: [${routingKeys.join(", ")}]`
65
- // );
66
- // await channel.consume(
67
- // queue,
68
- // (msg) => {
69
- // if (!msg) return;
70
- // const routingKey = msg.fields.routingKey;
71
- // const content = msg.content.toString();
72
- // try {
73
- // const data: T = JSON.parse(content);
74
- // // Handle messages based on routing key
75
- // switch (routingKey) {
76
- // case "user.created":
77
- // console.log("👤 User created:", data);
78
- // break;
79
- // case "user.updated":
80
- // console.log("✏️ User updated:", data);
81
- // break;
82
- // case "user.deleted":
83
- // console.log("🗑️ User deleted:", data);
84
- // break;
85
- // default:
86
- // console.warn("⚠️ Unhandled routing key:", routingKey, data);
87
- // }
88
- // channel.ack(msg);
89
- // } catch (err) {
90
- // console.error("❌ Failed to process message:", err);
91
- // channel.nack(msg, false, true);
92
- // }
93
- // },
94
- // { noAck: false }
95
- // );
96
- // } catch (error) {
97
- // console.error("Error setting up listener:", error);
98
- // }
99
- // }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docta-package",
3
- "version": "1.2.12",
3
+ "version": "1.2.14",
4
4
  "description": "This package will contail all the required files to run the docta micro-service app",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -35,6 +35,7 @@
35
35
  "class-transformer": "^0.5.1",
36
36
  "class-validator": "^0.14.2",
37
37
  "express": "^5.1.0",
38
+ "jsonwebtoken": "^9.0.2",
38
39
  "mongoose": "^8.19.1",
39
40
  "multer": "^2.0.2",
40
41
  "reflect-metadata": "^0.2.2",