@chain-registry/workflows 1.46.0 → 1.47.0
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/esm/validator.js +6 -0
- package/package.json +3 -3
- package/validator.d.ts +1 -0
- package/validator.js +6 -0
package/esm/validator.js
CHANGED
|
@@ -8,6 +8,7 @@ export class SchemaValidator {
|
|
|
8
8
|
registry;
|
|
9
9
|
options;
|
|
10
10
|
failures = 0;
|
|
11
|
+
tests = 0;
|
|
11
12
|
constructor(registry, options) {
|
|
12
13
|
const { useStrict = false, allErrors = true, useDefaults = true, draft = '2019-09', logLevel = 'info' } = options ?? {};
|
|
13
14
|
this.options = {
|
|
@@ -82,8 +83,13 @@ export class SchemaValidator {
|
|
|
82
83
|
if (this.options.allErrors && this.failures > 0) {
|
|
83
84
|
throw new Error('❌ Validation Failed.');
|
|
84
85
|
}
|
|
86
|
+
if (this.failures === 0) {
|
|
87
|
+
console.log(`✅ Validation Passed.`);
|
|
88
|
+
}
|
|
89
|
+
console.log(`${this.tests} Tests.`);
|
|
85
90
|
}
|
|
86
91
|
validateJsonSchema(data, title, validate, verbose) {
|
|
92
|
+
this.tests++;
|
|
87
93
|
if (!validate(data.content)) {
|
|
88
94
|
this.failures++;
|
|
89
95
|
if (['info', 'error'].includes(this.options.logLevel)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chain-registry/workflows",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.47.0",
|
|
4
4
|
"description": "Chain Registry Workflows",
|
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/cosmology-tech/chain-registry",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@types/sha.js": "^2.4.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@chain-registry/interfaces": "^0.
|
|
34
|
+
"@chain-registry/interfaces": "^0.46.0",
|
|
35
35
|
"ajv": "^8.12.0",
|
|
36
36
|
"ajv-formats": "^3.0.1",
|
|
37
37
|
"bignumber.js": "9.1.2",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"cosmos",
|
|
52
52
|
"interchain"
|
|
53
53
|
],
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "f6b313aca6c0953fbc5383cd365f5c060d970c55"
|
|
55
55
|
}
|
package/validator.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare class SchemaValidator {
|
|
|
11
11
|
private registry;
|
|
12
12
|
private options;
|
|
13
13
|
private failures;
|
|
14
|
+
private tests;
|
|
14
15
|
constructor(registry: Registry, options?: SchemaValidatorOptions);
|
|
15
16
|
validateAllData(verbose?: boolean): void;
|
|
16
17
|
private validateJsonSchema;
|
package/validator.js
CHANGED
|
@@ -14,6 +14,7 @@ class SchemaValidator {
|
|
|
14
14
|
registry;
|
|
15
15
|
options;
|
|
16
16
|
failures = 0;
|
|
17
|
+
tests = 0;
|
|
17
18
|
constructor(registry, options) {
|
|
18
19
|
const { useStrict = false, allErrors = true, useDefaults = true, draft = '2019-09', logLevel = 'info' } = options ?? {};
|
|
19
20
|
this.options = {
|
|
@@ -88,8 +89,13 @@ class SchemaValidator {
|
|
|
88
89
|
if (this.options.allErrors && this.failures > 0) {
|
|
89
90
|
throw new Error('❌ Validation Failed.');
|
|
90
91
|
}
|
|
92
|
+
if (this.failures === 0) {
|
|
93
|
+
console.log(`✅ Validation Passed.`);
|
|
94
|
+
}
|
|
95
|
+
console.log(`${this.tests} Tests.`);
|
|
91
96
|
}
|
|
92
97
|
validateJsonSchema(data, title, validate, verbose) {
|
|
98
|
+
this.tests++;
|
|
93
99
|
if (!validate(data.content)) {
|
|
94
100
|
this.failures++;
|
|
95
101
|
if (['info', 'error'].includes(this.options.logLevel)) {
|