@insignia-education/api-sdk-js 0.21.0 → 0.23.0
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@insignia-education/api-sdk-js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "JavaScript SDK for the Insignia Education API",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/preset-env": "^7.29.7",
|
|
37
37
|
"babel-jest": "^30.3.0",
|
|
38
|
-
"@eslint/js": "^
|
|
38
|
+
"@eslint/js": "^10.0.1",
|
|
39
39
|
"eslint": "^10.10.0",
|
|
40
40
|
"globals": "^17.12.0",
|
|
41
41
|
"jest": "^30.3.0",
|
package/src/api/v1/Admin.js
CHANGED
|
@@ -163,6 +163,13 @@ export default class Admin {
|
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
/** Organization-wide OpenAI completion usage, model breakdown and spend for a date range. Resolves `{ available: false }` when the API server has no valid OpenAI Admin API key. */
|
|
167
|
+
reportsOpenAiUsage({ fromDate, toDate } = {}) {
|
|
168
|
+
return this.#client.get('/admin/reports/openai-usage', {
|
|
169
|
+
from_date: fromDate, to_date: toDate,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
166
173
|
/** Direct link to a repo's CI-generated test-coverage HTML report ('api' | 'front' | 'api-sdk-js') — open with <a href>/<iframe src>, cookie-authenticated, not fetch. */
|
|
167
174
|
coverageUrl(repo) {
|
|
168
175
|
return `${this.#client.baseUrl}/admin/coverage/${repo}/`;
|
|
@@ -10,4 +10,7 @@ export default class AiGradingSettings {
|
|
|
10
10
|
|
|
11
11
|
/** Admin-only: update the provider/model choices. */
|
|
12
12
|
edit(data) { return this.#client.patch('/ai-grading-settings', data); }
|
|
13
|
+
|
|
14
|
+
/** Admin-only: live model choices (each provider's own catalog, cached) plus pricing, for the settings page's dropdowns. */
|
|
15
|
+
models() { return this.#client.get('/ai-grading-settings/models'); }
|
|
13
16
|
}
|