@onlineapps/service-wrapper 2.3.3 → 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.3",
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,11 +29,11 @@
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.106",
34
+ "@onlineapps/conn-orch-orchestrator": "1.0.108",
35
35
  "@onlineapps/conn-orch-registry": "1.1.55",
36
- "@onlineapps/conn-orch-validator": "2.0.32",
36
+ "@onlineapps/conn-orch-validator": "2.0.33",
37
37
  "@onlineapps/monitoring-core": "1.0.21",
38
38
  "@onlineapps/service-common": "1.0.18",
39
39
  "@onlineapps/runtime-config": "1.0.2"
@@ -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');
@@ -1426,8 +1433,7 @@ class ServiceWrapper {
1426
1433
  */
1427
1434
  async _startWorkflowInitListener() {
1428
1435
  if (!this.mqClient) {
1429
- this.logger?.warn('Cannot start workflow.init listener: MQ client not initialized');
1430
- return;
1436
+ throw new Error('[ServiceWrapper] Cannot start workflow.init listener MQ client not initialized. Queue infrastructure is required.');
1431
1437
  }
1432
1438
 
1433
1439
  const queueName = 'workflow.init';
@@ -1459,8 +1465,7 @@ class ServiceWrapper {
1459
1465
  */
1460
1466
  async _startWorkflowControlListener() {
1461
1467
  if (!this.mqClient) {
1462
- this.logger?.warn('Cannot start workflow.control listener: MQ client not initialized');
1463
- return;
1468
+ throw new Error('[ServiceWrapper] Cannot start workflow.control listener MQ client not initialized. Queue infrastructure is required.');
1464
1469
  }
1465
1470
 
1466
1471
  const queueName = 'workflow.control';
@@ -1491,8 +1496,7 @@ class ServiceWrapper {
1491
1496
  */
1492
1497
  async _startServiceWorkflowListener() {
1493
1498
  if (!this.mqClient) {
1494
- this.logger?.warn('Cannot start service workflow listener: MQ client not initialized');
1495
- return;
1499
+ throw new Error('[ServiceWrapper] Cannot start service workflow listener MQ client not initialized. Queue infrastructure is required.');
1496
1500
  }
1497
1501
 
1498
1502
  const serviceName = this.config.service?.name || 'unnamed-service';