@onlineapps/service-wrapper 2.1.91 → 2.1.93

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.91",
3
+ "version": "2.1.93",
4
4
  "description": "Thin orchestration layer for microservices - delegates all infrastructure concerns to specialized connectors",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -327,12 +327,22 @@ class ConfigLoader {
327
327
  customSections[k] = v;
328
328
  }
329
329
 
330
+ // FAIL-FAST: specificationEndpoint is REQUIRED (no fallbacks)
331
+ if (!serviceConfig.service.specificationEndpoint) {
332
+ throw new Error(
333
+ `[ConfigLoader] Missing required field - "specificationEndpoint" is required in conn-config/config.json under "service" section. ` +
334
+ `Fix: Add "specificationEndpoint": "/api/v1/specification" to config.json`
335
+ );
336
+ }
337
+
330
338
  return {
331
339
  service: {
332
340
  name: serviceConfig.service.name,
333
341
  version: serviceConfig.service.version,
334
342
  port: parseInt(serviceConfig.service.port, 10),
335
343
  url: serviceConfig.service.url,
344
+ specificationEndpoint: serviceConfig.service.specificationEndpoint,
345
+ description: serviceConfig.service.description,
336
346
  env: nodeEnv
337
347
  },
338
348
  wrapper: mergedWrapper,
@@ -828,14 +828,30 @@ class ServiceWrapper {
828
828
  // FÁZE 0.5 a 0.6: Vytvoření front a spuštění konzumerů se provádí v registryClient.init()
829
829
  // FÁZE 0.7: Registrace u Registry
830
830
 
831
+ // FAIL-FAST: specificationEndpoint MUST be in config, no fallbacks
832
+ const specificationEndpoint = this.config.service?.specificationEndpoint;
833
+ if (!specificationEndpoint) {
834
+ throw new Error(
835
+ `[ServiceWrapper] Missing required configuration - service.specificationEndpoint is required. ` +
836
+ `Fix: Add "specificationEndpoint": "/api/v1/specification" to conn-config/config.json under "service" section.`
837
+ );
838
+ }
839
+
840
+ // FAIL-FAST: logger must be initialized
841
+ if (!this.logger) {
842
+ throw new Error(
843
+ `[ServiceWrapper] Missing required dependency - logger is not initialized.`
844
+ );
845
+ }
846
+
831
847
  this.registryClient = new RegistryConnector.ServiceRegistryClient({
832
848
  amqpUrl: mqUrl,
833
849
  serviceName: serviceName,
834
850
  version: this.config.service?.version,
835
- specificationEndpoint: this.config.service?.specificationEndpoint || '/api/v1/specification',
851
+ specificationEndpoint: specificationEndpoint,
836
852
  registryQueue: 'registry.register', // Use correct queue name
837
853
  registryUrl: registryUrl,
838
- logger: this.logger || console,
854
+ logger: this.logger,
839
855
  validationProof: this.validationProof // Inject validation proof
840
856
  });
841
857
 
package/src/config.js CHANGED
@@ -23,3 +23,6 @@ const runtimeCfg = createRuntimeConfig({
23
23
  module.exports = runtimeCfg;
24
24
 
25
25
 
26
+
27
+
28
+
package/src/defaults.js CHANGED
@@ -12,3 +12,6 @@ module.exports = {
12
12
  };
13
13
 
14
14
 
15
+
16
+
17
+