@signalhousellc/sdk 1.0.11 → 1.0.13

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": "@signalhousellc/sdk",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "Signal House SDK for use with the Signal House platform",
5
5
  "type": "module",
6
6
  "main": "src/SignalHouseSDK.js",
@@ -33,4 +33,22 @@ export class Auth {
33
33
  const safeUserId = encodeURIComponent(userId);
34
34
  return this.client(`/auth/resetpassword/${safeUserId}`, { method: "PUT", body: { newPassword }, ...options });
35
35
  }
36
+
37
+ /**
38
+ * Get token login history for a group or user
39
+ * @async
40
+ * @roles signalhouse_admin, signalhouse_api, signalhouse_user, admin, api (groupId query); self (userId query)
41
+ * @param {Object} params
42
+ * @param {string} [params.groupId] - Returns history for all users in the group (one of groupId/userId required)
43
+ * @param {string} [params.userId] - Returns history for a specific user (one of groupId/userId required)
44
+ * @param {number} [params.page] - Page number (min 1, default 1)
45
+ * @param {number} [params.limit] - Results per page (min 1, max 100, default 20)
46
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
47
+ * @returns {Promise<Object>} The response from the server
48
+ */
49
+ async getAuthHistory({ groupId, userId, page, limit, options = {} }) {
50
+ this.client._require({ "groupId or userId": groupId ?? userId });
51
+ const queryString = this.client._getQueryString({ groupId, userId, page, limit });
52
+ return this.client(`/auth/history${queryString}`, { method: "GET", ...options });
53
+ }
36
54
  }
@@ -75,7 +75,7 @@ export class Users {
75
75
  */
76
76
  createInternalUser: async ({ data, options = {} }) => {
77
77
  this.client._require({ data: data });
78
- return this.client(`/user`, { method: "POST", body: data, ...options });
78
+ return this.client(`/user/signalhouse`, { method: "POST", body: data, ...options });
79
79
  },
80
80
  };
81
81
  }