feat(core): Add delete user functionality and necessary tests

This commit is contained in:
2024-08-27 08:13:52 +02:00
parent 66a4bf6142
commit 6ab9ab2c59
5 changed files with 36 additions and 5 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@apiclient.xyz/zitadel',
version: '1.0.9',
version: '1.1.0',
description: 'An unofficial client for interacting with Zitadel API, enabling user and project management functionalities.'
}

View File

@ -79,6 +79,12 @@ export class ZitaldelClient {
familyName: optionsArg.lastName,
}
});
console.log(response);
// const allUsers = await this.listUsers();
// console.log(JSON.stringify(allUsers, null, 2));
return new ZitaldelUser(this, {
id: response.userId,
lastLogin: null,
username: optionsArg.email,
});
}
}

View File

@ -64,4 +64,13 @@ export class ZitaldelUser {
userId: this.data.id,
});
}
/**
* deletes the user
*/
public async delete() {
const response = await this.zitadelclientRef.userClient.deleteUser({
userId: this.data.id,
});
}
}