@insignia-education/api-sdk-js 0.15.54 → 0.15.55
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/.nvmrc +1 -1
- package/package.json +2 -2
- package/src/api/v1/Users.js +25 -2
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
25
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@insignia-education/api-sdk-js",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.55",
|
|
4
4
|
"description": "JavaScript SDK for the Insignia Education API",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"author": "Insignia Education",
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"engines": {
|
|
23
|
-
"node": ">=
|
|
23
|
+
"node": ">=25"
|
|
24
24
|
},
|
|
25
25
|
"bugs": {
|
|
26
26
|
"url": "https://github.com/insignia-education/api-sdk-js/issues"
|
package/src/api/v1/Users.js
CHANGED
|
@@ -47,8 +47,31 @@ export default class Users {
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
courseNotes(userId) { return this.#nested(userId, 'course-notes'); }
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
|
|
51
|
+
/** get() accepts an optional { courseId } filter to narrow to a single course. */
|
|
52
|
+
quizzes(userId) {
|
|
53
|
+
const base = `/users/${userId}/quizzes`;
|
|
54
|
+
const client = this.#client;
|
|
55
|
+
return {
|
|
56
|
+
get: (id = null, { courseId } = {}) => id ? client.get(`${base}/${id}`) : client.get(courseId ? `${base}?course_id=${courseId}` : base),
|
|
57
|
+
create: (data) => client.put(base, data),
|
|
58
|
+
edit: (id, data) => client.patch(`${base}/${id}`, data),
|
|
59
|
+
delete: (id) => client.del(`${base}/${id}`),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** get() accepts an optional { courseId } filter to narrow to a single course. */
|
|
64
|
+
sessions(userId) {
|
|
65
|
+
const base = `/users/${userId}/sessions`;
|
|
66
|
+
const client = this.#client;
|
|
67
|
+
return {
|
|
68
|
+
get: (id = null, { courseId } = {}) => id ? client.get(`${base}/${id}`) : client.get(courseId ? `${base}?course_id=${courseId}` : base),
|
|
69
|
+
create: (data) => client.put(base, data),
|
|
70
|
+
edit: (id, data) => client.patch(`${base}/${id}`, data),
|
|
71
|
+
delete: (id) => client.del(`${base}/${id}`),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
52
75
|
surveys(userId) { return this.#nested(userId, 'surveys'); }
|
|
53
76
|
cart(userId) { return this.#nested(userId, 'cart'); }
|
|
54
77
|
|