@signalhousellc/sdk 1.0.12 → 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 +1 -1
- package/src/domains/Auth.js +18 -0
package/package.json
CHANGED
package/src/domains/Auth.js
CHANGED
|
@@ -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
|
}
|