@onlineapps/service-wrapper 2.1.44 → 2.1.46

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.1.44",
3
+ "version": "2.1.46",
4
4
  "description": "Thin orchestration layer for microservices - delegates all infrastructure concerns to specialized connectors",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -24,17 +24,18 @@
24
24
  "author": "OA Drive Team",
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
- "@onlineapps/conn-base-cache": "1.0.3",
28
- "@onlineapps/conn-base-monitoring": "1.0.2",
29
- "@onlineapps/conn-infra-error-handler": "^1.0.0",
30
- "@onlineapps/conn-infra-mq": "1.1.55",
27
+ "@onlineapps/conn-base-cache": "1.0.4",
28
+ "@onlineapps/conn-base-monitoring": "1.0.3",
29
+ "@onlineapps/conn-infra-error-handler": "1.0.2",
30
+ "@onlineapps/conn-infra-mq": "1.1.56",
31
31
  "@onlineapps/conn-orch-api-mapper": "1.0.15",
32
32
  "@onlineapps/conn-orch-cookbook": "2.0.13",
33
33
  "@onlineapps/conn-orch-orchestrator": "1.0.68",
34
- "@onlineapps/conn-orch-registry": "1.1.26",
35
- "@onlineapps/conn-orch-validator": "2.0.14",
36
- "@onlineapps/monitoring-core": "1.0.9",
37
- "@onlineapps/service-common": "1.0.6"
34
+ "@onlineapps/conn-orch-registry": "1.1.28",
35
+ "@onlineapps/conn-orch-validator": "2.0.16",
36
+ "@onlineapps/monitoring-core": "1.0.11",
37
+ "@onlineapps/service-common": "1.0.7",
38
+ "@onlineapps/runtime-config": "1.0.2"
38
39
  },
39
40
  "devDependencies": {
40
41
  "express": "^5.1.0",
@@ -23,6 +23,7 @@ const fs = require('fs');
23
23
  const path = require('path');
24
24
 
25
25
  const RUNTIME_DEFAULTS = require('../config/runtime-defaults.json');
26
+ const runtimeCfg = require('./config');
26
27
 
27
28
  /**
28
29
  * CENTRAL REGISTRY: All configuration files used by business services
@@ -302,6 +303,7 @@ class ConfigLoader {
302
303
  const serviceConfig = this.loadServiceConfig(basePath);
303
304
  const operations = this.loadOperations(basePath);
304
305
  const validationProof = this.loadValidationProof(basePath);
306
+ const nodeEnv = runtimeCfg.get('nodeEnv');
305
307
 
306
308
  // Include any custom top-level sections from config.json (e.g., storage, smtp, etc.)
307
309
  // Keep service-wrapper owned sections (service, wrapper) explicit and stable.
@@ -319,7 +321,7 @@ class ConfigLoader {
319
321
  version: serviceConfig.service.version,
320
322
  port: parseInt(serviceConfig.service.port, 10),
321
323
  url: serviceConfig.service.url,
322
- env: process.env.NODE_ENV
324
+ env: nodeEnv
323
325
  },
324
326
  wrapper: serviceConfig.wrapper || {},
325
327
  operations,
@@ -22,6 +22,7 @@ const CookbookConnector = require('@onlineapps/conn-orch-cookbook');
22
22
  const CacheConnector = require('@onlineapps/conn-base-cache');
23
23
  const ErrorHandlerConnector = require('@onlineapps/conn-infra-error-handler');
24
24
  const { ValidationOrchestrator } = require('@onlineapps/conn-orch-validator');
25
+ const runtimeCfg = require('./config');
25
26
 
26
27
  const INFRA_QUEUE_OWNERS = {
27
28
  'workflow.init': 'Gateway (api_gateway)',
@@ -1359,7 +1360,7 @@ class ServiceWrapper {
1359
1360
  }
1360
1361
 
1361
1362
  // DEBUG MODE: Run health check before workflow step
1362
- if (process.env.DEBUG === 'true' || process.env.NODE_ENV === 'development') {
1363
+ if (runtimeCfg.get('debug') || runtimeCfg.get('nodeEnv') === 'development') {
1363
1364
  await this._runHealthCheckBeforeWorkflowStep(message);
1364
1365
  }
1365
1366
 
package/src/config.js ADDED
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Runtime configuration schema for @onlineapps/service-wrapper.
5
+ *
6
+ * Uses @onlineapps/runtime-config for unified priority:
7
+ * 1. Explicit config (passed to APIs that need it)
8
+ * 2. Environment variable
9
+ * 3. Module-owned defaults (from ./defaults.js)
10
+ */
11
+
12
+ const { createRuntimeConfig } = require('@onlineapps/runtime-config');
13
+ const DEFAULTS = require('./defaults');
14
+
15
+ const runtimeCfg = createRuntimeConfig({
16
+ defaults: DEFAULTS,
17
+ schema: {
18
+ nodeEnv: { env: 'NODE_ENV', defaultKey: 'nodeEnv' },
19
+ debug: { env: 'DEBUG', defaultKey: 'debug', type: 'boolean' },
20
+ }
21
+ });
22
+
23
+ module.exports = runtimeCfg;
24
+
25
+
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Module-owned defaults for @onlineapps/service-wrapper (runtime config).
5
+ *
6
+ * NOTE: This is RuntimeConfig (ENV/explicit overrides), not biz ServiceConfig (conn-config/*.json).
7
+ */
8
+
9
+ module.exports = {
10
+ nodeEnv: 'development',
11
+ debug: false,
12
+ };
13
+
14
+