@insignia-education/api-sdk-js 0.15.22 → 0.15.24

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.15.22",
3
+ "version": "0.15.24",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -0,0 +1,10 @@
1
+ export default class Search {
2
+ #client;
3
+
4
+ constructor(client) {
5
+ this.#client = client;
6
+ }
7
+
8
+ /** Sales-and-above global search: users (name/email/dni) and courses (cod/title). */
9
+ query(q) { return this.#client.get('/search', { q }); }
10
+ }
@@ -85,6 +85,15 @@ export default class Users {
85
85
 
86
86
  statistics(userId) { return { get: () => this.#client.get(`/users/${userId}/statistics`) }; }
87
87
 
88
+ /** Read-only: login attempts are recorded by the auth flow itself, not over the API. */
89
+ logins(userId) {
90
+ const base = `/users/${userId}/logins`;
91
+ const client = this.#client;
92
+ return {
93
+ get: () => client.get(base),
94
+ };
95
+ }
96
+
88
97
  experiences(userId) {
89
98
  const base = `/users/${userId}/experiences`;
90
99
  const client = this.#client;
@@ -21,6 +21,7 @@ import Organizations from './Organizations.js';
21
21
  import PaymentMethods from './PaymentMethods.js';
22
22
  import Payments from './Payments.js';
23
23
  import Quizzes from './Quizzes.js';
24
+ import Search from './Search.js';
24
25
  import ShortLinks from './ShortLinks.js';
25
26
  import Surveys from './Surveys.js';
26
27
  import Premiums from './Premiums.js';
@@ -69,6 +70,7 @@ export default class InsigniaApiV1 extends InsigniaApi {
69
70
  this.paymentMethods = new PaymentMethods(this);
70
71
  this.payments = new Payments(this);
71
72
  this.quizzes = new Quizzes(this);
73
+ this.search = new Search(this);
72
74
  this.shortLinks = new ShortLinks(this);
73
75
  this.surveys = new Surveys(this);
74
76
  this.premiums = new Premiums(this);