message-brokers 1.1.2 → 1.1.4

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.
@@ -95,6 +95,13 @@ declare module "message-brokers" {
95
95
  */
96
96
  publishHarStub(har_stub: object): Promise<PublishResponse>;
97
97
 
98
+ /**
99
+ * Publishes a trending data into the exchange.
100
+ * @param trending_data - The trending data object to be published.
101
+ * @returns A promise that resolves to a response object.
102
+ */
103
+ publishTrendingData(trending_data: object): Promise<PublishResponse>;
104
+
98
105
  /**
99
106
  * Publishes all pending messages stored in the cache.
100
107
  * @returns A promise that resolves to a response object indicating the result of the operation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "message-brokers",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "This package contains functions to publish the messages into the message brokers like rabbitmq.",
5
5
  "main": "lib/message-brokers.js",
6
6
  "types": "lib/types/message-brokers.d.ts",
@@ -12,7 +12,7 @@
12
12
  ],
13
13
  "scripts": {
14
14
  "install_deps": "NODE_ENV='development' yarn",
15
- "build": "babel ./src -d ./lib && cp -r ./src/types ./lib/types",
15
+ "build": "babel ./src -d ./lib && cp -r ./src/types/message-brokers.d.ts ./lib/types",
16
16
  "prepublishOnly": "npm run build"
17
17
  },
18
18
  "author": "Akif Mohammed <akiif.dev@gmail.com> (https://akiif.dev)",
@@ -1,111 +0,0 @@
1
- declare module "message-brokers" {
2
- interface MongoDbCredentials {
3
- /**
4
- * The connection string for MongoDB, including protocol, host, and port.
5
- */
6
- mongoDbUrl: string;
7
-
8
- /**
9
- * The name of the MongoDB database to connect to.
10
- */
11
- mongoDbName?: string;
12
- }
13
-
14
- interface PublishResponse {
15
- success: boolean;
16
- message: string;
17
- data: any;
18
- }
19
-
20
- interface MessageBrokersConfig {
21
- /**
22
- * The RabbitMQ connection URL.
23
- */
24
- rabbitmqUrl?: string;
25
-
26
- /**
27
- * The name of the RabbitMQ exchange.
28
- */
29
- exchangeName?: string;
30
-
31
- /**
32
- * MongoDB credentials for database connection.
33
- */
34
- mongoDbCredentials?: MongoDbCredentials;
35
- }
36
-
37
- class MessageBrokers {
38
- /**
39
- * Initializes the MessageBrokers instance.
40
- * Throws an error if required configurations (like RabbitMQ URL) are missing.
41
- *
42
- * @param mongoDbCredentials - MongoDB credentials for connecting to the database.
43
- * @param config - Optional configurations for the message broker (e.g., RabbitMQ URL, exchange name).
44
- */
45
- constructor(mongoDbCredentials: MongoDbCredentials, config?: MessageBrokersConfig);
46
-
47
- /**
48
- * Publishes a HAR object into the exchange.
49
- * @param har - The HAR object to be published.
50
- * @returns A promise that resolves to a response object.
51
- */
52
- publishHar(har: object): Promise<PublishResponse>;
53
-
54
- /**
55
- * Publishes a HAR meta object into the exchange.
56
- * @param har_meta - The HAR meta object to be published.
57
- * @returns A promise that resolves to a response object.
58
- */
59
- publishHarMeta(har_meta: object): Promise<PublishResponse>;
60
-
61
- /**
62
- * Publishes a lab API response into the exchange.
63
- * @param lab_api_response - The lab API response object to be published.
64
- * @returns A promise that resolves to a response object.
65
- */
66
- publishLabApiResponse(lab_api_response: object): Promise<PublishResponse>;
67
-
68
- /**
69
- * Publishes a HAR lab API response into the exchange.
70
- * @param harLab_api_response - The HAR lab API response object to be published.
71
- * @returns A promise that resolves to a response object.
72
- */
73
- publishHarLabApiResponse(harLab_api_response: object): Promise<PublishResponse>;
74
-
75
- /**
76
- * Publishes purchase details into the exchange.
77
- * @param purchase_details - The purchase details object to be published.
78
- * @returns A promise that resolves to a response object.
79
- */
80
- publishPurchaseDetails(purchase_details: object): Promise<PublishResponse>;
81
-
82
- /**
83
- * Publishes lab location data into the exchange.
84
- * @param lab_location_data - The lab location data object to be published.
85
- * @returns A promise that resolves to a response object.
86
- */
87
- publishLabLocationData(lab_location_data: object): Promise<PublishResponse>;
88
-
89
- /**
90
- * Publishes an input object into the exchange.
91
- * @param input_object - The input object to be published.
92
- * @returns A promise that resolves to a response object.
93
- */
94
- publishInputObject(input_object: object): Promise<PublishResponse>;
95
-
96
- /**
97
- * Publishes a HAR stub into the exchange.
98
- * @param har_stub - The HAR stub object to be published.
99
- * @returns A promise that resolves to a response object.
100
- */
101
- publishHarStub(har_stub: object): Promise<PublishResponse>;
102
-
103
- /**
104
- * Publishes all pending messages stored in the cache.
105
- * @returns A promise that resolves to a response object indicating the result of the operation.
106
- */
107
- publishPendingMessageInCache(): Promise<PublishResponse>;
108
- }
109
-
110
- export = MessageBrokers;
111
- }