@extrahorizon/exh-cli 1.13.6-dev-217-47bf800 → 1.13.6-dev-219-0b40795
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/CHANGELOG.md +2 -0
- package/build/config-json-schemas/Schema.json +24 -6
- package/build/helpers/util.js +10 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Extra Horizon CLI changelog
|
|
2
2
|
|
|
3
3
|
### v1.13.6
|
|
4
|
+
* Improved the reporting of errors from the API, including additional information when available
|
|
5
|
+
* Fixed some inconsistencies in the data schema validation, now better aligned with the backend
|
|
4
6
|
* Fixed a bug in `exh data schemas sync` where permission mode arrays were not being correctly compared
|
|
5
7
|
* Updated the ExH SDK to `8.13.0` to fix a security warning from `form-data` (vulnerable code was not in use)
|
|
6
8
|
|
|
@@ -3,8 +3,16 @@
|
|
|
3
3
|
"type": "object",
|
|
4
4
|
"properties": {
|
|
5
5
|
"$schema": { "type": "string" },
|
|
6
|
-
"name": {
|
|
7
|
-
|
|
6
|
+
"name": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"minLength": 3,
|
|
9
|
+
"maxLength": 50
|
|
10
|
+
},
|
|
11
|
+
"description": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"minLength": 3,
|
|
14
|
+
"maxLength": 100
|
|
15
|
+
},
|
|
8
16
|
"createMode": {
|
|
9
17
|
"oneOf": [
|
|
10
18
|
{
|
|
@@ -88,8 +96,14 @@
|
|
|
88
96
|
"linkedUsersPatientEnlistments"
|
|
89
97
|
]
|
|
90
98
|
},
|
|
91
|
-
"defaultLimit": {
|
|
92
|
-
|
|
99
|
+
"defaultLimit": {
|
|
100
|
+
"type": "integer",
|
|
101
|
+
"minimum": 1
|
|
102
|
+
},
|
|
103
|
+
"maximumLimit": {
|
|
104
|
+
"type": "integer",
|
|
105
|
+
"minimum": 1
|
|
106
|
+
},
|
|
93
107
|
"statuses": {
|
|
94
108
|
"type": "object",
|
|
95
109
|
"patternProperties": {
|
|
@@ -172,7 +186,8 @@
|
|
|
172
186
|
"const": "manual"
|
|
173
187
|
},
|
|
174
188
|
"name": {
|
|
175
|
-
"type": "string"
|
|
189
|
+
"type": "string",
|
|
190
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_-]{0,49}$"
|
|
176
191
|
},
|
|
177
192
|
"description": {
|
|
178
193
|
"type": "string"
|
|
@@ -233,7 +248,10 @@
|
|
|
233
248
|
"type": "object",
|
|
234
249
|
"properties": {
|
|
235
250
|
"type": { "const": "automatic" },
|
|
236
|
-
"name": {
|
|
251
|
+
"name": {
|
|
252
|
+
"type": "string",
|
|
253
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_-]{0,49}$"
|
|
254
|
+
},
|
|
237
255
|
"description": { "type": "string" },
|
|
238
256
|
"fromStatuses": {
|
|
239
257
|
"type": "array",
|
package/build/helpers/util.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.getAjvErrorStrings = exports.ajvValidate = exports.getSwaggerDocumentati
|
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const path = require("path");
|
|
7
|
+
const javascript_sdk_1 = require("@extrahorizon/javascript-sdk");
|
|
7
8
|
const ajv_1 = require("ajv");
|
|
8
9
|
const chalk = require("chalk");
|
|
9
10
|
const error_1 = require("./error");
|
|
@@ -14,11 +15,19 @@ function epilogue(y) {
|
|
|
14
15
|
process.exit(1);
|
|
15
16
|
}
|
|
16
17
|
if (err) {
|
|
17
|
-
console.log(chalk.red(err.message));
|
|
18
|
+
console.log(chalk.red(`${err.name}: ${err.message}`));
|
|
18
19
|
}
|
|
19
20
|
else {
|
|
20
21
|
console.log(chalk.red(msg));
|
|
21
22
|
}
|
|
23
|
+
if (err instanceof javascript_sdk_1.ApiError && err.response) {
|
|
24
|
+
for (const [key, value] of Object.entries(err.response)) {
|
|
25
|
+
if (['code', 'name', 'message'].includes(key)) {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
console.log(chalk.red(` ${key}:`), value);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
22
31
|
console.log('\nUsage:');
|
|
23
32
|
console.log(argv.help());
|
|
24
33
|
process.exit(1);
|