@tostudy-ai/cli 0.17.3 → 0.17.4
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/cli.js +14 -3
- package/dist/cli.js.map +2 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1153,10 +1153,10 @@ function createHttpProvider(apiUrl, token) {
|
|
|
1153
1153
|
}
|
|
1154
1154
|
},
|
|
1155
1155
|
exercises: {
|
|
1156
|
-
validate: async (lessonId, solution, _userId, enrollmentId) => {
|
|
1156
|
+
validate: async (lessonId, solution, _userId, enrollmentId, metadata) => {
|
|
1157
1157
|
return cliApiFetch(`${base}/exercises/validate`, token, {
|
|
1158
1158
|
method: "POST",
|
|
1159
|
-
body: JSON.stringify({ lessonId, solution, enrollmentId })
|
|
1159
|
+
body: JSON.stringify({ lessonId, solution, enrollmentId, metadata })
|
|
1160
1160
|
});
|
|
1161
1161
|
},
|
|
1162
1162
|
getEnrollmentLevels: async (enrollmentId) => {
|
|
@@ -5186,6 +5186,15 @@ var init_hint = __esm({
|
|
|
5186
5186
|
// ../../packages/tostudy-core/src/exercises/validate-solution.ts
|
|
5187
5187
|
async function validateSolution(input2, deps) {
|
|
5188
5188
|
deps.logger.info("tostudy-core: validateSolution", { lessonId: input2.lessonId });
|
|
5189
|
+
if (input2.metadata !== void 0) {
|
|
5190
|
+
return deps.data.exercises.validate(
|
|
5191
|
+
input2.lessonId,
|
|
5192
|
+
input2.solution,
|
|
5193
|
+
input2.userId,
|
|
5194
|
+
input2.enrollmentId,
|
|
5195
|
+
input2.metadata
|
|
5196
|
+
);
|
|
5197
|
+
}
|
|
5189
5198
|
return deps.data.exercises.validate(
|
|
5190
5199
|
input2.lessonId,
|
|
5191
5200
|
input2.solution,
|
|
@@ -20146,6 +20155,7 @@ var init_validate = __esm({
|
|
|
20146
20155
|
init_formatter();
|
|
20147
20156
|
init_init_template();
|
|
20148
20157
|
init_errors();
|
|
20158
|
+
init_version();
|
|
20149
20159
|
logger16 = createLogger("cli:validate");
|
|
20150
20160
|
validateCommand = new Command14("validate").description("Validate your solution for the current exercise").argument("[file]", "Path to the solution file to read").option("--stdin", "Read solution from stdin instead of a file").option("--json", "Output structured JSON").action(async (file2, opts) => {
|
|
20151
20161
|
try {
|
|
@@ -20229,7 +20239,8 @@ var init_validate = __esm({
|
|
|
20229
20239
|
lessonId,
|
|
20230
20240
|
solution,
|
|
20231
20241
|
userId: session.userId,
|
|
20232
|
-
enrollmentId: activeCourse.enrollmentId
|
|
20242
|
+
enrollmentId: activeCourse.enrollmentId,
|
|
20243
|
+
metadata: { clientVersion: CLI_VERSION }
|
|
20233
20244
|
},
|
|
20234
20245
|
deps
|
|
20235
20246
|
);
|