Skip to content

Commit 7e94b95

Browse files
authored
Merge pull request #63 from cranberyxl/feature/deleteUser
Implement deleteUser
2 parents e20ab50 + 26fbe69 commit 7e94b95

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

index.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,14 @@ export interface UsersApi {
976976
*/
977977
getUser(userId: string): Promise<Response<UserIdentity>>;
978978

979+
/**
980+
* Delete an Authress user
981+
* @summary Delete a user.
982+
* @param {string} userId The user identifier.
983+
* @throws {ArgumentRequiredError}
984+
*/
985+
deleteUser(userId: string): Promise<Response<void>>;
986+
979987
/**
980988
* Set user token configuration
981989
* @summary Sets the user authentication configuration. This endpoint contains properties that allow detailed control over tokens generated for the user.

src/usersApi.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ class UsersApi {
1515
return response;
1616
}
1717

18+
async deleteUser(userId) {
19+
// verify required parameter 'userId' is not null or undefined
20+
if (userId === null || userId === undefined) {
21+
throw new ArgumentRequiredError('userId', 'Required parameter userId was null or undefined when calling deleteUser.');
22+
}
23+
const url = `/v1/users/${encodeURIComponent(String(userId))}`;
24+
const response = await this.client.delete(url);
25+
return response;
26+
}
27+
1828
async setUserTokenConfiguration(userId, tokenConfiguration) {
1929
if (userId === null || userId === undefined) {
2030
throw new ArgumentRequiredError('userId', 'Required parameter userId was null or undefined when calling setUserTokenConfiguration.');

0 commit comments

Comments
 (0)