@insignia-education/api-sdk-js 0.15.107 → 0.15.108
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/Courses.js +11 -3
- package/src/api/v1/Users.js +2 -0
package/package.json
CHANGED
package/src/api/v1/Courses.js
CHANGED
|
@@ -16,9 +16,17 @@ export default class Courses {
|
|
|
16
16
|
return this.#client.get(qs ? `/courses?${qs}` : '/courses');
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Fetch all courses in a single unpaginated request (per_page=0).
|
|
21
|
+
* `enabledOnly: true` forces disabled courses out of the result even for a
|
|
22
|
+
* logged-in staff session — the default (employee sees everything, everyone
|
|
23
|
+
* else sees only enabled) still applies when omitted. Use this on genuinely
|
|
24
|
+
* public-facing pages (the /courses catalog, course detail pages) so staff
|
|
25
|
+
* browsing the live site see exactly what a real visitor sees.
|
|
26
|
+
*/
|
|
27
|
+
getAll({ enabledOnly = false } = {}) {
|
|
28
|
+
const qs = enabledOnly ? '&enabled_only=1' : '';
|
|
29
|
+
return this.#client.get(`/courses?per_page=0${qs}`);
|
|
22
30
|
}
|
|
23
31
|
create(data) { return this.#client.put('/courses', data); }
|
|
24
32
|
edit(id, data) { return this.#client.patch(`/courses/${id}`, data); }
|
package/src/api/v1/Users.js
CHANGED
|
@@ -134,6 +134,8 @@ export default class Users {
|
|
|
134
134
|
delete: (id) => client.del(`${base}/${id}`),
|
|
135
135
|
verify: (id, data) => client.post(`${base}/${id}/verify`, data),
|
|
136
136
|
reject: (id, data) => client.post(`${base}/${id}/reject`, data),
|
|
137
|
+
/** Admin-only manual credit/debit of the buyer's account balance — { money_added, money_substracted, password|webauthn_credential, captcha_token }. */
|
|
138
|
+
adjustMoney: (id, data) => client.post(`${base}/${id}/money`, data),
|
|
137
139
|
/** Preview pricing (with any auto-applied Offer) for a prospective cart, without creating a payment. */
|
|
138
140
|
quote: (data) => client.post(`${base}/quote`, data),
|
|
139
141
|
/** Creates a Stripe PaymentIntent for this cart; returns { client_secret, publishable_key, amount } to mount Stripe Elements with. */
|