@onlineapps/service-wrapper 2.1.92 → 2.1.94
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 +1 -1
- package/src/ConfigLoader.js +10 -0
- package/src/ServiceWrapper.js +3 -4
- package/src/index.js +2 -0
package/package.json
CHANGED
package/src/ConfigLoader.js
CHANGED
|
@@ -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,
|
package/src/ServiceWrapper.js
CHANGED
|
@@ -828,7 +828,7 @@ 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
|
|
831
|
+
// FAIL-FAST: specificationEndpoint MUST be in config, no fallbacks
|
|
832
832
|
const specificationEndpoint = this.config.service?.specificationEndpoint;
|
|
833
833
|
if (!specificationEndpoint) {
|
|
834
834
|
throw new Error(
|
|
@@ -837,11 +837,10 @@ class ServiceWrapper {
|
|
|
837
837
|
);
|
|
838
838
|
}
|
|
839
839
|
|
|
840
|
-
// FAIL-FAST: logger must be
|
|
840
|
+
// FAIL-FAST: logger must be initialized
|
|
841
841
|
if (!this.logger) {
|
|
842
842
|
throw new Error(
|
|
843
|
-
`[ServiceWrapper] Missing required dependency - logger is not initialized
|
|
844
|
-
`This is an internal error - logger should be set before registry initialization.`
|
|
843
|
+
`[ServiceWrapper] Missing required dependency - logger is not initialized.`
|
|
845
844
|
);
|
|
846
845
|
}
|
|
847
846
|
|
package/src/index.js
CHANGED
|
@@ -114,6 +114,8 @@ async function bootstrap(serviceRoot, options = {}) {
|
|
|
114
114
|
version: config.service.version,
|
|
115
115
|
port: config.service.port,
|
|
116
116
|
url: config.service.url,
|
|
117
|
+
specificationEndpoint: config.service.specificationEndpoint,
|
|
118
|
+
description: config.service.description,
|
|
117
119
|
env: config.service.env || runtimeCfg.get('nodeEnv')
|
|
118
120
|
},
|
|
119
121
|
wrapper: config.wrapper
|