@insignia-education/api-sdk-js 0.15.95 → 0.15.97
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/package.json +1 -1
- package/src/api/v1/Admin.js +14 -0
- package/src/api/v1/Auth.js +4 -0
package/package.json
CHANGED
package/src/api/v1/Admin.js
CHANGED
|
@@ -55,6 +55,20 @@ export default class Admin {
|
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
/** Paginated per-teacher report for a date range: hours given, sessions given, absences (substituted out) and substitutions (covered for someone else). */
|
|
59
|
+
reportsTeacherStats({ fromDate, toDate, page, perPage } = {}) {
|
|
60
|
+
return this.#client.get('/admin/reports/teacher-stats', {
|
|
61
|
+
from_date: fromDate, to_date: toDate, page, per_page: perPage,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Direct download link for the teacher-stats report (format: 'csv' | 'xlsx'). */
|
|
66
|
+
reportsTeacherStatsExportUrl({ fromDate, toDate, format = 'csv' } = {}) {
|
|
67
|
+
return Admin.#buildUrl(this.#client.baseUrl, '/admin/reports/teacher-stats/export', {
|
|
68
|
+
from_date: fromDate, to_date: toDate, format,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
58
72
|
static #buildUrl(baseUrl, path, params) {
|
|
59
73
|
const qs = new URLSearchParams(
|
|
60
74
|
Object.entries(params).filter(([, v]) => v !== undefined && v !== null && v !== '')
|
package/src/api/v1/Auth.js
CHANGED
|
@@ -23,4 +23,8 @@ export default class Auth {
|
|
|
23
23
|
twoFactor(data) { return this.#client.post('/auth/2fa', data); }
|
|
24
24
|
/** GDPR Art. 8 — clicked by the guardian from the consent email, not the account holder; no session is created. */
|
|
25
25
|
guardianConsentConfirm(hash) { return this.#client.post(`/guardian-consent/${hash}`); }
|
|
26
|
+
/** GDPR Art. 8 — a blocked minor (user.guardian_consent_required) submits their guardian's
|
|
27
|
+
* email from the dashboard gate; exempted from the guardian-consent block server-side so
|
|
28
|
+
* it's reachable even while everything else 403s. */
|
|
29
|
+
submitGuardianEmail(email) { return this.#client.post('/auth/guardian-email', { email }); }
|
|
26
30
|
}
|