@examplary/cli 1.11.1 → 1.13.1
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/dist/lib/response-processing.js +4 -1
- package/dist/lib/validate.js +15 -0
- package/dist/preview-ui/assets/icon-nodes-CxaTPv-R.js +2 -0
- package/dist/preview-ui/assets/icon-nodes-CxaTPv-R.js.map +1 -0
- package/dist/preview-ui/assets/index-CQu7xfsN.js +3637 -0
- package/dist/preview-ui/assets/{index-drvY5o6H.js.map → index-CQu7xfsN.js.map} +1 -1
- package/dist/preview-ui/assets/index-qyJhpejV.css +1 -0
- package/dist/preview-ui/assets/tags-BUvo71XG.js +2 -0
- package/dist/preview-ui/assets/tags-BUvo71XG.js.map +1 -0
- package/dist/preview-ui/index.html +2 -2
- package/package.json +3 -3
- package/dist/preview-ui/assets/icon-nodes-DWBwwVXR.js +0 -2
- package/dist/preview-ui/assets/icon-nodes-DWBwwVXR.js.map +0 -1
- package/dist/preview-ui/assets/index-B1uq9ooZ.css +0 -1
- package/dist/preview-ui/assets/index-drvY5o6H.js +0 -3637
- package/dist/preview-ui/assets/tags-DkzE0dXT.js +0 -2
- package/dist/preview-ui/assets/tags-DkzE0dXT.js.map +0 -1
|
@@ -9,7 +9,10 @@ const evaluateCondition = async (condition, data) => {
|
|
|
9
9
|
throw new Error("Invalid response processing condition: must start with '='");
|
|
10
10
|
}
|
|
11
11
|
const outcome = await jsonata(condition.substring(1)).evaluate(data);
|
|
12
|
-
|
|
12
|
+
if (typeof outcome !== "boolean") {
|
|
13
|
+
throw new Error(`Response processing condition must evaluate to a boolean, got ${typeof outcome}`);
|
|
14
|
+
}
|
|
15
|
+
return outcome;
|
|
13
16
|
};
|
|
14
17
|
/**
|
|
15
18
|
* Runs every `responseProcessing.testCases` through the `condition` and checks
|
package/dist/lib/validate.js
CHANGED
|
@@ -52,6 +52,21 @@ export const validateDefinition = async (definition, dir) => {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
+
// Validate the grading file inputs expression
|
|
56
|
+
const fileInputs = definition.grading?.fileInputs;
|
|
57
|
+
if (fileInputs !== undefined) {
|
|
58
|
+
if (!fileInputs.startsWith("=")) {
|
|
59
|
+
errors.push("Invalid grading.fileInputs expression: must start with '='");
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
try {
|
|
63
|
+
await deepCompileJsonata(fileInputs);
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
errors.push(`Invalid JSONata expression in grading.fileInputs: ${e.message}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
55
70
|
// Bundle components to confirm they build and to capture their output
|
|
56
71
|
for (const [componentType, componentPath] of Object.entries(definition.components || {})) {
|
|
57
72
|
if (!VALID_COMPONENT_TYPES.includes(componentType)) {
|