@onlineapps/conn-base-hub 1.0.0 → 1.0.2
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 +37 -2
- package/coverage/base.css +0 -0
- package/coverage/block-navigation.js +0 -0
- package/coverage/clover.xml +0 -0
- package/coverage/coverage-final.json +0 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -0
- package/coverage/index.js.html +0 -0
- package/coverage/lcov-report/base.css +0 -0
- package/coverage/lcov-report/block-navigation.js +0 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -0
- package/coverage/lcov-report/index.js.html +0 -0
- package/coverage/lcov-report/prettify.css +0 -0
- package/coverage/lcov-report/prettify.js +0 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -0
- package/coverage/lcov.info +0 -0
- package/coverage/prettify.css +0 -0
- package/coverage/prettify.js +0 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -0
- package/jest.integration.config.js +0 -0
- package/onlineapps-conn-base-hub-1.0.0.tgz +0 -0
- package/package.json +4 -4
- package/src/config.js +0 -0
- package/src/index.js +15 -24
- package/{test → tests}/component/hub-integration.test.js +1 -1
- package/{test → tests}/unit/hub.test.js +1 -1
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
|
package/coverage/clover.xml
CHANGED
|
File without changes
|
|
File without changes
|
package/coverage/favicon.png
CHANGED
|
File without changes
|
package/coverage/index.html
CHANGED
|
File without changes
|
package/coverage/index.js.html
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
|
package/coverage/lcov.info
CHANGED
|
File without changes
|
package/coverage/prettify.css
CHANGED
|
File without changes
|
package/coverage/prettify.js
CHANGED
|
File without changes
|
|
File without changes
|
package/coverage/sorter.js
CHANGED
|
File without changes
|
|
File without changes
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onlineapps/conn-base-hub",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
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": {
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"registry"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
+
"@onlineapps/conn-base-monitoring": "^1.0.0",
|
|
25
|
+
"@onlineapps/conn-base-storage": "^1.0.0",
|
|
26
|
+
"@onlineapps/conn-infra-mq": "1.1.53",
|
|
24
27
|
"@onlineapps/conn-orch-cookbook": "^2.0.0",
|
|
25
|
-
"@onlineapps/conn-base-logger": "^1.0.0",
|
|
26
|
-
"@onlineapps/conn-infra-mq": "^1.1.0",
|
|
27
28
|
"@onlineapps/conn-orch-registry": "^1.1.4",
|
|
28
|
-
"@onlineapps/conn-base-storage": "^1.0.0",
|
|
29
29
|
"dotenv": "^16.0.3"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
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
|
-
//
|
|
29
|
+
// Monitoring connector
|
|
30
|
+
MonitoringConnector: require('@onlineapps/conn-base-monitoring'),
|
|
31
|
+
|
|
32
|
+
// Legacy createLogger for backward compatibility
|
|
30
33
|
createLogger: (() => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return
|
|
36
|
-
|
|
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 ||
|
|
83
|
-
port: parseInt(process.env.MINIO_PORT ||
|
|
84
|
-
accessKey: process.env.MINIO_ACCESS_KEY ||
|
|
85
|
-
secretKey: process.env.MINIO_SECRET_KEY ||
|
|
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
|
|