@nauth-toolkit/client 0.1.111 → 0.1.112
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/dist/index.cjs +11 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +16 -7
- package/dist/index.d.ts +16 -7
- package/dist/index.mjs +11 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -191,6 +191,7 @@ var defaultAdminEndpoints = {
|
|
|
191
191
|
getUserSessions: "/users/:sub/sessions",
|
|
192
192
|
logoutAll: "/users/:sub/logout-all",
|
|
193
193
|
getMfaStatus: "/users/:sub/mfa/status",
|
|
194
|
+
getMfaDevices: "/users/:sub/mfa/devices",
|
|
194
195
|
removeMfaDeviceById: "/mfa/devices/:deviceId",
|
|
195
196
|
setPreferredMfaDevice: "/users/:sub/mfa/devices/:deviceId/preferred",
|
|
196
197
|
setMfaExemption: "/mfa/exemption",
|
|
@@ -1151,21 +1152,25 @@ var AdminOperations = class {
|
|
|
1151
1152
|
return this.get(path);
|
|
1152
1153
|
}
|
|
1153
1154
|
/**
|
|
1154
|
-
*
|
|
1155
|
+
* Get MFA devices for a user
|
|
1155
1156
|
*
|
|
1156
|
-
*
|
|
1157
|
-
* Remove MFA devices for a user
|
|
1157
|
+
* Returns all active MFA devices for a user including device id, name, type, and isPreferred status.
|
|
1158
1158
|
*
|
|
1159
1159
|
* @param sub - User UUID
|
|
1160
|
-
* @
|
|
1161
|
-
* @returns Success message
|
|
1160
|
+
* @returns Response containing array of MFA devices
|
|
1162
1161
|
* @throws {NAuthClientError} If operation fails
|
|
1163
1162
|
*
|
|
1164
1163
|
* @example
|
|
1165
1164
|
* ```typescript
|
|
1166
|
-
* await client.admin.
|
|
1165
|
+
* const result = await client.admin.getMfaDevices('user-uuid');
|
|
1166
|
+
* console.log('Devices:', result.devices);
|
|
1167
|
+
* // [{ id: 1, name: 'My Authenticator', type: 'totp', isPreferred: true, ... }]
|
|
1167
1168
|
* ```
|
|
1168
1169
|
*/
|
|
1170
|
+
async getMfaDevices(sub) {
|
|
1171
|
+
const path = this.buildAdminUrl(this.adminEndpoints.getMfaDevices, { sub });
|
|
1172
|
+
return this.get(path);
|
|
1173
|
+
}
|
|
1169
1174
|
/**
|
|
1170
1175
|
* Remove a single MFA device by device ID (admin).
|
|
1171
1176
|
*
|