@onlineapps/service-validator-core 1.0.5 → 1.0.7
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/jest.config.js +1 -1
- package/package.json +1 -1
- package/src/types/ValidationProofSchema.js +1 -1
- package/src/utils/FingerprintUtils.js +24 -7
- package/{test → tests}/component/validation-flow.test.js +1 -1
- package/{test → tests}/integration/real-validation.test.js +1 -1
- package/{test → tests}/unit/ValidationCore.test.js +1 -1
package/jest.config.js
CHANGED
package/package.json
CHANGED
|
@@ -35,7 +35,7 @@ class ValidationProofSchema {
|
|
|
35
35
|
type: 'string',
|
|
36
36
|
required: true,
|
|
37
37
|
description: 'Name of the validator that generated the proof',
|
|
38
|
-
example: '@onlineapps/conn-
|
|
38
|
+
example: '@onlineapps/conn-orch-validator'
|
|
39
39
|
},
|
|
40
40
|
validatorVersion: {
|
|
41
41
|
type: 'string',
|
|
@@ -56,18 +56,35 @@ class FingerprintUtils {
|
|
|
56
56
|
* Used for cache validation - skip re-validation if config unchanged
|
|
57
57
|
*
|
|
58
58
|
* @param {Object} config - Service configuration
|
|
59
|
-
* @param {string} config.version - Service version
|
|
60
|
-
* @param {Array} config.endpoints - API endpoints
|
|
61
|
-
* @param {Object} config.metadata - Service metadata
|
|
62
|
-
* @param {string} config.health - Health check endpoint
|
|
59
|
+
* @param {string} config.version - Service version (REQUIRED)
|
|
60
|
+
* @param {Array} config.endpoints - API endpoints (REQUIRED)
|
|
61
|
+
* @param {Object} config.metadata - Service metadata (REQUIRED)
|
|
62
|
+
* @param {string} config.health - Health check endpoint (REQUIRED)
|
|
63
63
|
* @returns {string} Configuration fingerprint
|
|
64
|
+
* @throws {Error} If any required field is missing
|
|
64
65
|
*/
|
|
65
66
|
static generateConfigFingerprint(config) {
|
|
67
|
+
if (!config) {
|
|
68
|
+
throw new Error('Config is required for generateConfigFingerprint');
|
|
69
|
+
}
|
|
70
|
+
if (!config.version) {
|
|
71
|
+
throw new Error('config.version is required');
|
|
72
|
+
}
|
|
73
|
+
if (!Array.isArray(config.endpoints)) {
|
|
74
|
+
throw new Error('config.endpoints must be an array');
|
|
75
|
+
}
|
|
76
|
+
if (typeof config.metadata !== 'object' || config.metadata === null) {
|
|
77
|
+
throw new Error('config.metadata must be an object');
|
|
78
|
+
}
|
|
79
|
+
if (!config.health) {
|
|
80
|
+
throw new Error('config.health is required');
|
|
81
|
+
}
|
|
82
|
+
|
|
66
83
|
return this.generate({
|
|
67
84
|
version: config.version,
|
|
68
|
-
endpoints: config.endpoints
|
|
69
|
-
metadata: config.metadata
|
|
70
|
-
health: config.health
|
|
85
|
+
endpoints: config.endpoints,
|
|
86
|
+
metadata: config.metadata,
|
|
87
|
+
health: config.health
|
|
71
88
|
});
|
|
72
89
|
}
|
|
73
90
|
|
|
@@ -2,7 +2,7 @@ const ValidationCore = require('../../src/index');
|
|
|
2
2
|
const fs = require('fs').promises;
|
|
3
3
|
const path = require('path');
|
|
4
4
|
|
|
5
|
-
describe('ValidationCore Integration Tests', () => {
|
|
5
|
+
describe('ValidationCore Integration Tests @integration', () => {
|
|
6
6
|
let validationCore;
|
|
7
7
|
|
|
8
8
|
beforeEach(() => {
|