@meshmakers/octo-services 3.4.210 → 3.4.230

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.
@@ -4652,6 +4652,41 @@ class IdentityService {
4652
4652
  }));
4653
4653
  }
4654
4654
  }
4655
+ // ----- Client role assignment (AB#4183) -----
4656
+ async getClientRoles(clientId) {
4657
+ const baseUrl = await this.getApiBaseUrl();
4658
+ if (baseUrl) {
4659
+ const response = await firstValueFrom(this.httpClient.get(baseUrl + `clients/${clientId}/roles`, {
4660
+ observe: 'response'
4661
+ }));
4662
+ return response.body;
4663
+ }
4664
+ return null;
4665
+ }
4666
+ async updateClientRoles(clientId, roleIds) {
4667
+ const baseUrl = await this.getApiBaseUrl();
4668
+ if (baseUrl) {
4669
+ await firstValueFrom(this.httpClient.put(baseUrl + `clients/${clientId}/roles`, roleIds, {
4670
+ observe: 'response'
4671
+ }));
4672
+ }
4673
+ }
4674
+ async addClientToRole(clientId, roleName) {
4675
+ const baseUrl = await this.getApiBaseUrl();
4676
+ if (baseUrl) {
4677
+ await firstValueFrom(this.httpClient.put(baseUrl + `clients/${clientId}/roles/${roleName}`, null, {
4678
+ observe: 'response'
4679
+ }));
4680
+ }
4681
+ }
4682
+ async removeRoleFromClient(clientId, roleName) {
4683
+ const baseUrl = await this.getApiBaseUrl();
4684
+ if (baseUrl) {
4685
+ await firstValueFrom(this.httpClient.delete(baseUrl + `clients/${clientId}/roles/${roleName}`, {
4686
+ observe: 'response'
4687
+ }));
4688
+ }
4689
+ }
4655
4690
  async mergeUsers(targetUserName, sourceUserName) {
4656
4691
  const baseUrl = await this.getApiBaseUrl();
4657
4692
  if (baseUrl) {
@@ -5046,6 +5081,22 @@ class IdentityService {
5046
5081
  }));
5047
5082
  }
5048
5083
  }
5084
+ async addClientToGroup(rtId, clientId) {
5085
+ const baseUrl = await this.getApiBaseUrl();
5086
+ if (baseUrl) {
5087
+ await firstValueFrom(this.httpClient.put(baseUrl + `groups/${rtId}/members/clients/${clientId}`, null, {
5088
+ observe: 'response'
5089
+ }));
5090
+ }
5091
+ }
5092
+ async removeClientFromGroup(rtId, clientId) {
5093
+ const baseUrl = await this.getApiBaseUrl();
5094
+ if (baseUrl) {
5095
+ await firstValueFrom(this.httpClient.delete(baseUrl + `groups/${rtId}/members/clients/${clientId}`, {
5096
+ observe: 'response'
5097
+ }));
5098
+ }
5099
+ }
5049
5100
  async addGroupToGroup(rtId, childGroupId) {
5050
5101
  const baseUrl = await this.getApiBaseUrl();
5051
5102
  if (baseUrl) {