@insignia-education/api-sdk-js 0.13.0 → 0.15.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/coverage/clover.xml +187 -153
- package/coverage/coverage-final.json +7 -6
- package/coverage/lcov-report/Client.js.html +108 -12
- package/coverage/lcov-report/index.html +26 -26
- package/coverage/lcov-report/src/Client.js.html +76 -76
- package/coverage/lcov-report/src/api/index.html +1 -1
- package/coverage/lcov-report/src/api/index.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/Accounts.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/Auth.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/Categories.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/Changelogs.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/Configs.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/ContactForms.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/ConversationalTopics.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/Countries.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/Coupons.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/Courses.js.html +17 -8
- package/coverage/lcov-report/src/api/v1/Currencies.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/Files.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/Forums.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/Hashes.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/Insignias.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/Languages.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/MailBlacklist.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/Organizations.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/PaymentMethods.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/Payments.js.html +121 -0
- package/coverage/lcov-report/src/api/v1/Quizzes.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/ShortLinks.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/Surveys.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/Taxes.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/Teacher.js.html +34 -10
- package/coverage/lcov-report/src/api/v1/UserTypes.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/Users.js.html +26 -8
- package/coverage/lcov-report/src/api/v1/Zoom.js.html +1 -1
- package/coverage/lcov-report/src/api/v1/index.html +50 -35
- package/coverage/lcov-report/src/api/v1/index.js.html +10 -4
- package/coverage/lcov-report/src/index.html +15 -15
- package/coverage/lcov-report/src/index.js.html +1 -1
- package/coverage/lcov-report/tests/helpers.js.html +1 -1
- package/coverage/lcov-report/tests/index.html +1 -1
- package/coverage/lcov.info +280 -226
- package/coverage/test-report.html +606 -1
- package/package.json +1 -1
- package/src/api/v1/Payments.js +12 -0
- package/src/api/v1/Teacher.js +5 -1
- package/src/api/v1/Users.js +4 -0
- package/src/api/v1/index.js +2 -0
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default class Payments {
|
|
2
|
+
#client;
|
|
3
|
+
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.#client = client;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** Employee-only: paginated list of all payments. status: 'pending' | 'approved' | 'rejected'. */
|
|
9
|
+
get({ status = null, page = 1, perPage = 15 } = {}) {
|
|
10
|
+
return this.#client.get('/payments', { status, page, per_page: perPage });
|
|
11
|
+
}
|
|
12
|
+
}
|
package/src/api/v1/Teacher.js
CHANGED
|
@@ -32,7 +32,11 @@ export default class Teacher {
|
|
|
32
32
|
configs() {
|
|
33
33
|
const base = '/teacher/configs';
|
|
34
34
|
return {
|
|
35
|
-
get
|
|
35
|
+
/** get() / get(id) / get({ config_set_id }) — the last filters the list to one config set. */
|
|
36
|
+
get: (idOrParams = null) => {
|
|
37
|
+
if (idOrParams && typeof idOrParams === 'object') return this.#client.get(base, idOrParams);
|
|
38
|
+
return idOrParams ? this.#client.get(`${base}/${idOrParams}`) : this.#client.get(base);
|
|
39
|
+
},
|
|
36
40
|
create: (data) => this.#client.put(base, data),
|
|
37
41
|
edit: (id, data) => this.#client.patch(`${base}/${id}`, data),
|
|
38
42
|
delete: (id) => this.#client.del(`${base}/${id}`),
|
package/src/api/v1/Users.js
CHANGED
|
@@ -13,6 +13,10 @@ export default class Users {
|
|
|
13
13
|
assignable() { return this.#client.get('/users/assignable'); }
|
|
14
14
|
/** Employee-only: users assignable as a course teacher (super-admins, admins, employees, teachers). */
|
|
15
15
|
assignableTeachers() { return this.#client.get('/users/assignable-teachers'); }
|
|
16
|
+
/** Employee-only: paginated list of teacher-type users, for the admin Teachers view. */
|
|
17
|
+
teachers({ page = 1, perPage = 15 } = {}) {
|
|
18
|
+
return this.#client.get('/users/teachers', { page, per_page: perPage });
|
|
19
|
+
}
|
|
16
20
|
edit(id, data) { return this.#client.patch(`/users/${id}`, data); }
|
|
17
21
|
|
|
18
22
|
#nested(userId, path) {
|
package/src/api/v1/index.js
CHANGED
|
@@ -18,6 +18,7 @@ import Languages from './Languages.js';
|
|
|
18
18
|
import MailBlacklist from './MailBlacklist.js';
|
|
19
19
|
import Organizations from './Organizations.js';
|
|
20
20
|
import PaymentMethods from './PaymentMethods.js';
|
|
21
|
+
import Payments from './Payments.js';
|
|
21
22
|
import Quizzes from './Quizzes.js';
|
|
22
23
|
import ShortLinks from './ShortLinks.js';
|
|
23
24
|
import Surveys from './Surveys.js';
|
|
@@ -58,6 +59,7 @@ export default class InsigniaApiV1 extends InsigniaApi {
|
|
|
58
59
|
this.mailBlacklist = new MailBlacklist(this);
|
|
59
60
|
this.organizations = new Organizations(this);
|
|
60
61
|
this.paymentMethods = new PaymentMethods(this);
|
|
62
|
+
this.payments = new Payments(this);
|
|
61
63
|
this.quizzes = new Quizzes(this);
|
|
62
64
|
this.shortLinks = new ShortLinks(this);
|
|
63
65
|
this.surveys = new Surveys(this);
|