@playcademy/better-auth 0.0.14 → 0.0.15-beta.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/server.js +27 -0
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -16158,6 +16158,33 @@ function createTimebackNamespace(client) {
|
|
|
16158
16158
|
const queryString = params.toString();
|
|
16159
16159
|
const endpoint = `/api/timeback/student-xp/${studentId}?${queryString}`;
|
|
16160
16160
|
return client["request"](endpoint, "GET");
|
|
16161
|
+
},
|
|
16162
|
+
getStudentMastery: async (studentId, options) => {
|
|
16163
|
+
const hasGrade = options?.grade !== undefined;
|
|
16164
|
+
const hasSubject = options?.subject !== undefined;
|
|
16165
|
+
if (hasGrade !== hasSubject) {
|
|
16166
|
+
throw new Error("Both grade and subject must be provided together");
|
|
16167
|
+
}
|
|
16168
|
+
if (hasGrade && !isValidGrade(options.grade)) {
|
|
16169
|
+
throw new Error(`Invalid grade: ${options.grade}. Valid grades: ${VALID_GRADES.join(", ")}`);
|
|
16170
|
+
}
|
|
16171
|
+
if (hasSubject && !isValidSubject(options.subject)) {
|
|
16172
|
+
throw new Error(`Invalid subject: ${options.subject}. Valid subjects: ${VALID_SUBJECTS.join(", ")}`);
|
|
16173
|
+
}
|
|
16174
|
+
const params = new URLSearchParams;
|
|
16175
|
+
params.set("gameId", client.gameId);
|
|
16176
|
+
if (options?.grade !== undefined) {
|
|
16177
|
+
params.set("grade", String(options.grade));
|
|
16178
|
+
}
|
|
16179
|
+
if (options?.subject) {
|
|
16180
|
+
params.set("subject", options.subject);
|
|
16181
|
+
}
|
|
16182
|
+
if (options?.include?.length) {
|
|
16183
|
+
params.set("include", options.include.join(","));
|
|
16184
|
+
}
|
|
16185
|
+
const queryString = params.toString();
|
|
16186
|
+
const endpoint = `/api/timeback/student-mastery/${studentId}?${queryString}`;
|
|
16187
|
+
return client["request"](endpoint, "GET");
|
|
16161
16188
|
}
|
|
16162
16189
|
};
|
|
16163
16190
|
}
|