Remove deprecated setOrCreateChild() method from Admin Client (#33022)

Closes #33021

Signed-off-by: Jon Koops <jonkoops@gmail.com>
This commit is contained in:
Jon Koops 2024-09-18 09:33:54 +02:00 committed by GitHub
parent 3e597722a9
commit 8bb3598129
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 32 deletions

View file

@ -276,3 +276,7 @@ There are now generalized events for updating (`UPDATE_CREDENTIAL`) and removing
The new event types are supported by the Email Event Listener. The new event types are supported by the Email Event Listener.
The following event types are now deprecated and will be removed in a future version: `UPDATE_PASSWORD`, `UPDATE_PASSWORD_ERROR`, `UPDATE_TOTP`, `UPDATE_TOTP_ERROR`, `REMOVE_TOTP`, `REMOVE_TOTP_ERROR` The following event types are now deprecated and will be removed in a future version: `UPDATE_PASSWORD`, `UPDATE_PASSWORD_ERROR`, `UPDATE_TOTP`, `UPDATE_TOTP_ERROR`, `REMOVE_TOTP`, `REMOVE_TOTP_ERROR`
= `setOrCreateChild()` method removed from JavaScript Admin Client
The `groups.setOrCreateChild()` method has been removed from that JavaScript-based Admin Client. If you are still using this method then use the `createChildGroup()` or `updateChildGroup()` methods instead.

View file

@ -93,22 +93,6 @@ export class Groups extends Resource<{ realm?: string }> {
path: "/count", path: "/count",
}); });
/**
* Set or create child.
* This will just set the parent if it exists. Create it and set the parent if the group doesnt exist.
* @deprecated Use `createChildGroup` or `updateChildGroup` instead.
*/
public setOrCreateChild = this.makeUpdateRequest<
{ id: string },
GroupRepresentation,
{ id: string }
>({
method: "POST",
path: "/{id}/children",
urlParamKeys: ["id"],
returnResourceIdInLocationHeader: { field: "id" },
});
/** /**
* Creates a child group on the specified parent group. If the group already exists, then an error is returned. * Creates a child group on the specified parent group. If the group already exists, then an error is returned.
*/ */

View file

@ -81,22 +81,6 @@ describe("Groups", () => {
}); });
}); });
it("set or create child", async () => {
const groupName = "child-group";
const groupId = currentGroup.id;
const childGroup = await kcAdminClient.groups.setOrCreateChild(
{ id: groupId! },
{ name: groupName },
);
expect(childGroup.id).to.be.ok;
const group = (await kcAdminClient.groups.findOne({
id: groupId!,
}))!;
expect(group).to.be.ok;
});
it("list subgroups", async () => { it("list subgroups", async () => {
if (currentGroup.id) { if (currentGroup.id) {
const args: SubGroupQuery = { const args: SubGroupQuery = {