@onlineapps/conn-base-hub 1.0.0 → 1.0.1

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/README.md CHANGED
@@ -1,6 +1,41 @@
1
+ # @onlineapps/conn-base-hub
2
+
3
+ Base utilities and shared functionality for all OA Drive connectors.
4
+
5
+ ## Features
6
+
7
+ - 🔧 **Core utilities** - Shared helper functions
8
+ - 📝 **Configuration management** - Environment variable handling
9
+ - 🔄 **Common patterns** - Reusable patterns for connectors
10
+ - 🛡️ **Validation helpers** - Input/output validation utilities
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install @onlineapps/conn-base-hub
16
+ ```
17
+
18
+ ## Quick Start
19
+
20
+ ```javascript
21
+ const { ConfigLoader, ValidationHelper } = require('@onlineapps/conn-base-hub');
22
+
23
+ // Load configuration with defaults
24
+ const config = ConfigLoader.load({
25
+ SERVICE_NAME: { required: true },
26
+ PORT: { default: 3000, type: 'number' },
27
+ DEBUG: { default: false, type: 'boolean' }
28
+ });
29
+
30
+ // Validate input
31
+ const isValid = ValidationHelper.validateInput(data, schema);
32
+ ```
33
+
34
+ ## API Reference
35
+
36
+ See [API Documentation](./docs/api.md) for detailed API reference.
1
37
 
2
38
  ## 📚 Documentation
3
39
 
4
40
  - [Complete Connectors Documentation](../../../docs/modules/connector.md)
5
- - [Testing Standards](../../../docs/modules/connector.md#testing-standards)
6
-
41
+ - [Testing Standards](../../../docs/modules/connector.md#testing-standards)
package/coverage/base.css CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlineapps/conn-base-hub",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Central hub for OA Drive connectors - bundles and integrates all essential connector libraries",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "dependencies": {
24
24
  "@onlineapps/conn-orch-cookbook": "^2.0.0",
25
- "@onlineapps/conn-base-logger": "^1.0.0",
25
+ "@onlineapps/conn-base-monitoring": "^1.0.0",
26
26
  "@onlineapps/conn-infra-mq": "^1.1.0",
27
27
  "@onlineapps/conn-orch-registry": "^1.1.4",
28
28
  "@onlineapps/conn-base-storage": "^1.0.0",
package/src/config.js CHANGED
File without changes
package/src/index.js CHANGED
@@ -26,26 +26,17 @@ module.exports = {
26
26
  // Storage connector for MinIO with fingerprinting
27
27
  StorageConnector: require('@onlineapps/conn-base-storage'),
28
28
 
29
- // Logger (if available)
29
+ // Monitoring connector
30
+ MonitoringConnector: require('@onlineapps/conn-base-monitoring'),
31
+
32
+ // Legacy createLogger for backward compatibility
30
33
  createLogger: (() => {
31
- try {
32
- return require('@onlineapps/conn-base-logger');
33
- } catch (e) {
34
- // Logger not available, return console as fallback
35
- return function(config) {
36
- return {
37
- info: console.log,
38
- error: console.error,
39
- warn: console.warn,
40
- debug: console.debug,
41
- api: { info: console.log, error: console.error },
42
- mq: { info: console.log, error: console.error },
43
- workflow: { info: console.log, error: console.error },
44
- registry: { info: console.log, error: console.error },
45
- close: async () => {}
46
- };
47
- };
48
- }
34
+ const monitoring = require('@onlineapps/conn-base-monitoring');
35
+ return async function(config) {
36
+ // Initialize monitoring and return logger-like interface
37
+ await monitoring.init(config);
38
+ return monitoring;
39
+ };
49
40
  })(),
50
41
 
51
42
  // Convenience factory for creating a fully configured microservice
@@ -77,12 +68,12 @@ module.exports = {
77
68
  ...config.mq
78
69
  }) : null,
79
70
 
80
- // Initialize Storage
71
+ // Initialize Storage (all MinIO config MUST come from env or config - no fallbacks)
81
72
  storage: config.storage ? new StorageConnector({
82
- endPoint: process.env.MINIO_ENDPOINT || 'localhost',
83
- port: parseInt(process.env.MINIO_PORT || 9000),
84
- accessKey: process.env.MINIO_ACCESS_KEY || 'minioadmin',
85
- secretKey: process.env.MINIO_SECRET_KEY || 'minioadmin',
73
+ endPoint: process.env.MINIO_ENDPOINT || config.storage?.endPoint,
74
+ port: parseInt(process.env.MINIO_PORT || config.storage?.port),
75
+ accessKey: process.env.MINIO_ACCESS_KEY || config.storage?.accessKey,
76
+ secretKey: process.env.MINIO_SECRET_KEY || config.storage?.secretKey,
86
77
  ...config.storage
87
78
  }) : null,
88
79
 
@@ -48,7 +48,7 @@ jest.mock('@onlineapps/connector-logger', () => {
48
48
  }));
49
49
  }, { virtual: true });
50
50
 
51
- describe('Hub Connector Component Tests', () => {
51
+ describe('Hub Connector Component Tests @component', () => {
52
52
  let hub;
53
53
  let mockConfig;
54
54
 
@@ -47,7 +47,7 @@ jest.mock('@onlineapps/connector-cookbook', () => ({
47
47
  executeCookbook: jest.fn()
48
48
  }), { virtual: true });
49
49
 
50
- describe('ConnectorHub', () => {
50
+ describe('ConnectorHub @unit', () => {
51
51
  beforeEach(() => {
52
52
  jest.clearAllMocks();
53
53
  });