@onlineapps/service-wrapper 2.1.57 → 2.1.59

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.57",
3
+ "version": "2.1.59",
4
4
  "description": "Thin orchestration layer for microservices - delegates all infrastructure concerns to specialized connectors",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -32,7 +32,7 @@
32
32
  "@onlineapps/conn-orch-cookbook": "2.0.16",
33
33
  "@onlineapps/conn-orch-orchestrator": "1.0.72",
34
34
  "@onlineapps/conn-orch-registry": "1.1.33",
35
- "@onlineapps/conn-orch-validator": "2.0.22",
35
+ "@onlineapps/conn-orch-validator": "2.0.23",
36
36
  "@onlineapps/monitoring-core": "1.0.15",
37
37
  "@onlineapps/service-common": "1.0.12",
38
38
  "@onlineapps/runtime-config": "1.0.2"
@@ -303,6 +303,20 @@ class ConfigLoader {
303
303
  const validationProof = this.loadValidationProof(basePath);
304
304
  const nodeEnv = runtimeCfg.get('nodeEnv');
305
305
 
306
+ // Load service-wrapper runtime defaults (wrapper config only)
307
+ const runtimeDefaultsPath = path.join(__dirname, '..', 'config', 'runtime-defaults.json');
308
+ let runtimeDefaults = {};
309
+ try {
310
+ const runtimeDefaultsRaw = fs.readFileSync(runtimeDefaultsPath, 'utf8');
311
+ const parsed = JSON.parse(runtimeDefaultsRaw);
312
+ runtimeDefaults = parsed && typeof parsed === 'object' && parsed.defaults ? parsed.defaults : {};
313
+ } catch (error) {
314
+ throw new Error(`[ConfigLoader] Failed to load runtime defaults - Expected readable JSON at ${runtimeDefaultsPath}. ${error.message}`);
315
+ }
316
+
317
+ // Deep-merge defaults into wrapper config (service overrides win)
318
+ const mergedWrapper = this.deepMerge(runtimeDefaults.wrapper || {}, serviceConfig.wrapper || {});
319
+
306
320
  // Include any custom top-level sections from config.json (e.g., storage, smtp, etc.)
307
321
  // Keep service-wrapper owned sections (service, wrapper) explicit and stable.
308
322
  const customSections = {};
@@ -321,7 +335,7 @@ class ConfigLoader {
321
335
  url: serviceConfig.service.url,
322
336
  env: nodeEnv
323
337
  },
324
- wrapper: serviceConfig.wrapper || {},
338
+ wrapper: mergedWrapper,
325
339
  operations,
326
340
  validationProof,
327
341
  ...customSections