@onlineapps/mq-client-core 1.0.17 → 1.0.19

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +12 -19
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlineapps/mq-client-core",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "Core MQ client library for RabbitMQ - shared by infrastructure services and connectors",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -18,26 +18,19 @@ const {
18
18
  } = require('./utils/errorHandler');
19
19
  const { initInfrastructureQueues } = require('./utils/initInfrastructureQueues');
20
20
 
21
- // Export BaseClient as default, with additional exports
21
+ // Export BaseClient as default (constructor), with additional named exports
22
22
  // NOTE: When destructuring, use: const { initInfrastructureQueues } = require('@onlineapps/mq-client-core');
23
23
  // When using default, use: const BaseClient = require('@onlineapps/mq-client-core');
24
- const exports = {
25
- BaseClient,
26
- RabbitMQClient,
27
- initInfrastructureQueues,
28
- errors: {
29
- ValidationError,
30
- ConnectionError,
31
- PublishError,
32
- ConsumeError,
33
- SerializationError,
34
- }
24
+ // BaseClient must be a constructor, so we export it directly and attach other exports as properties
25
+ module.exports = BaseClient;
26
+ module.exports.BaseClient = BaseClient;
27
+ module.exports.RabbitMQClient = RabbitMQClient;
28
+ module.exports.initInfrastructureQueues = initInfrastructureQueues;
29
+ module.exports.errors = {
30
+ ValidationError,
31
+ ConnectionError,
32
+ PublishError,
33
+ ConsumeError,
34
+ SerializationError,
35
35
  };
36
36
 
37
- // Set default export to BaseClient (for backward compatibility)
38
- Object.setPrototypeOf(exports, BaseClient);
39
- Object.assign(exports, BaseClient);
40
-
41
- // Export as both default and named exports
42
- module.exports = exports;
43
-