@onlineapps/service-wrapper 2.3.4 → 2.3.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlineapps/service-wrapper",
3
- "version": "2.3.4",
3
+ "version": "2.3.5",
4
4
  "description": "Thin orchestration layer for microservices - delegates all infrastructure concerns to specialized connectors",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -29,9 +29,9 @@
29
29
  "@onlineapps/conn-base-monitoring": "1.0.10",
30
30
  "@onlineapps/conn-infra-error-handler": "1.0.9",
31
31
  "@onlineapps/conn-infra-mq": "1.1.69",
32
- "@onlineapps/conn-orch-api-mapper": "1.0.31",
32
+ "@onlineapps/conn-orch-api-mapper": "1.0.32",
33
33
  "@onlineapps/conn-orch-cookbook": "2.0.38",
34
- "@onlineapps/conn-orch-orchestrator": "1.0.107",
34
+ "@onlineapps/conn-orch-orchestrator": "1.0.108",
35
35
  "@onlineapps/conn-orch-registry": "1.1.55",
36
36
  "@onlineapps/conn-orch-validator": "2.0.33",
37
37
  "@onlineapps/monitoring-core": "1.0.21",
@@ -1396,15 +1396,22 @@ class ServiceWrapper {
1396
1396
  // Store error handler for use in message processing
1397
1397
  this.errorHandler = errorHandler;
1398
1398
 
1399
- // Create API mapper for HTTP calls (never direct calls)
1399
+ if (!this.logger) {
1400
+ throw new Error('[ServiceWrapper] Logger not initialized — cannot create orchestrator');
1401
+ }
1402
+
1400
1403
  const apiMapper = ApiMapperConnector.create({
1401
- openApiSpec: this.operations, // Using operations.json instead of OpenAPI
1404
+ openApiSpec: this.operations,
1402
1405
  serviceUrl: serviceUrl,
1403
- directCall: false, // ALWAYS use HTTP pattern
1404
- logger: this.logger || console
1406
+ directCall: false,
1407
+ logger: this.logger
1405
1408
  });
1406
1409
 
1407
- // Create orchestrator
1410
+ const timeout = this.config.wrapper?.timeout;
1411
+ if (!timeout || typeof timeout !== 'number') {
1412
+ throw new Error('[ServiceWrapper] config.wrapper.timeout is required — Expected number (ms)');
1413
+ }
1414
+
1408
1415
  this.orchestrator = OrchestratorConnector.create({
1409
1416
  mqClient: this.mqClient,
1410
1417
  registryClient: this.registryClient,
@@ -1412,8 +1419,8 @@ class ServiceWrapper {
1412
1419
  cookbook: CookbookConnector,
1413
1420
  cache: this.cacheConnector,
1414
1421
  errorHandler: errorHandler,
1415
- logger: this.logger || console,
1416
- defaultTimeout: this.config.wrapper?.timeout || 30000
1422
+ logger: this.logger,
1423
+ defaultTimeout: timeout
1417
1424
  });
1418
1425
 
1419
1426
  this.logger?.info('Orchestrator initialized');