From 5ba1e454235a345aa9056e4f9cd4d80b635ea585 Mon Sep 17 00:00:00 2001 From: Max Peintner Date: Tue, 2 Nov 2021 09:03:02 +0100 Subject: [PATCH] feat(console): change my username (#2587) * feat: username change * use btn, update on dist * disable mgmt side * lint * rm scope * chore(deps-dev): bump eslint from 7.32.0 to 8.1.0 in /console (#2569) Bumps [eslint](https://github.com/eslint/eslint) from 7.32.0 to 8.1.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.32.0...v8.1.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump ts-node from 10.2.1 to 10.4.0 in /console (#2568) Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 10.2.1 to 10.4.0. - [Release notes](https://github.com/TypeStrong/ts-node/releases) - [Commits](https://github.com/TypeStrong/ts-node/compare/v10.2.1...v10.4.0) --- updated-dependencies: - dependency-name: ts-node dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump @types/node from 16.10.2 to 16.11.4 in /console (#2567) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.10.2 to 16.11.4. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * cli core * material, cdk * eslint schematics * legacy peer deps * grpcweb, types * dontgrade eslint * revert package mods * change username mgmt Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- console/src/app/app.module.ts | 15 +- .../auth-user-detail.component.html | 159 ++-- .../auth-user-detail.component.ts | 26 + .../detail-form/detail-form.component.html | 89 +- .../detail-form/detail-form.component.scss | 16 + .../detail-form/detail-form.component.ts | 7 +- .../user-detail/user-detail.component.html | 2 +- .../user-detail/user-detail.component.ts | 284 ++++--- console/src/app/services/grpc-auth.service.ts | 8 + console/src/app/services/grpc.service.ts | 11 +- console/src/app/services/mgmt.service.ts | 804 +++++++++--------- console/src/assets/i18n/de.json | 4 + console/src/assets/i18n/en.json | 4 + 13 files changed, 782 insertions(+), 647 deletions(-) diff --git a/console/src/app/app.module.ts b/console/src/app/app.module.ts index 825e144533..86f6889fa7 100644 --- a/console/src/app/app.module.ts +++ b/console/src/app/app.module.ts @@ -80,10 +80,7 @@ const authConfig: AuthConfig = { }; @NgModule({ - declarations: [ - AppComponent, - SignedoutComponent, - ], + declarations: [AppComponent, SignedoutComponent], imports: [ AppRoutingModule, CommonModule, @@ -91,7 +88,12 @@ const authConfig: AuthConfig = { OverlayModule, OAuthModule.forRoot({ resourceServer: { - allowedUrls: ['https://test.api.zitadel.caos.ch/caos.zitadel.auth.api.v1.AuthService', 'https://test.api.zitadel.caos.ch/oauth/v2/userinfo', 'https://test.api.zitadel.caos.ch/caos.zitadel.management.api.v1.ManagementService/', 'https://preview.api.zitadel.caos.ch'], + allowedUrls: [ + 'https://test.api.zitadel.caos.ch/caos.zitadel.auth.api.v1.AuthService', + 'https://test.api.zitadel.caos.ch/oauth/v2/userinfo', + 'https://test.api.zitadel.caos.ch/caos.zitadel.management.api.v1.ManagementService/', + 'https://preview.api.zitadel.caos.ch', + ], sendAccessToken: true, }, }), @@ -185,7 +187,6 @@ const authConfig: AuthConfig = { ], bootstrap: [AppComponent], }) - export class AppModule { - constructor() { } + constructor() {} } diff --git a/console/src/app/pages/users/user-detail/auth-user-detail/auth-user-detail.component.html b/console/src/app/pages/users/user-detail/auth-user-detail/auth-user-detail.component.html index b6377906fd..1da9dbd3ff 100644 --- a/console/src/app/pages/users/user-detail/auth-user-detail/auth-user-detail.component.html +++ b/console/src/app/pages/users/user-detail/auth-user-detail/auth-user-detail.component.html @@ -1,82 +1,85 @@ -
-
-
-

{{ 'USER.TITLE' | translate }}

-

{{'USER.DESCRIPTION' | translate}}

-
- -
- -
-
- - - {{ 'USER.PAGES.NOUSER' | translate }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
-
- {{'RESOURCEID' | translate}}: - {{ user.id }} -
-
- {{'USER.PREFERRED_LOGINNAME' | translate}} - {{user.preferredLoginName}} -
+
+
+
+

{{ 'USER.TITLE' | translate }}

+

{{'USER.DESCRIPTION' | translate}}

+
+ +
+
- - -
- - - -
-
- - - - -
+ + + {{ 'USER.PAGES.NOUSER' | translate }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+ {{'RESOURCEID' | translate}}: + {{ user.id }} +
+
+ {{'USER.PREFERRED_LOGINNAME' | translate}} + {{user.preferredLoginName}} +
+
+ + +
+ + + +
+
+ + + + +
+
\ No newline at end of file diff --git a/console/src/app/pages/users/user-detail/auth-user-detail/auth-user-detail.component.ts b/console/src/app/pages/users/user-detail/auth-user-detail/auth-user-detail.component.ts index dc2b9a1ef7..614e495ec1 100644 --- a/console/src/app/pages/users/user-detail/auth-user-detail/auth-user-detail.component.ts +++ b/console/src/app/pages/users/user-detail/auth-user-detail/auth-user-detail.component.ts @@ -58,6 +58,32 @@ export class AuthUserDetailComponent implements OnDestroy { this.subscription.unsubscribe(); } + public changeUsername(): void { + const dialogRefPhone = this.dialog.open(EditDialogComponent, { + data: { + confirmKey: 'ACTIONS.CHANGE', + cancelKey: 'ACTIONS.CANCEL', + labelKey: 'ACTIONS.NEWVALUE', + titleKey: 'USER.PROFILE.CHANGEUSERNAME_TITLE', + descriptionKey: 'USER.PROFILE.CHANGEUSERNAME_DESC', + value: this.user.userName, + }, + width: '400px', + }); + + dialogRefPhone.afterClosed().subscribe(resp => { + if (resp && resp !== this.user.userName) { + this.userService.updateMyUserName(resp).then(() => { + this.toast.showInfo('USER.TOAST.USERNAMECHANGED', true); + this.refreshUser(); + }) + .catch(error => { + this.toast.showError(error); + }); + } + }); + } + public saveProfile(profileData: Profile.AsObject): void { if (this.user.human) { this.user.human.profile = profileData; diff --git a/console/src/app/pages/users/user-detail/detail-form/detail-form.component.html b/console/src/app/pages/users/user-detail/detail-form/detail-form.component.html index 5965586a61..a62619a0c8 100644 --- a/console/src/app/pages/users/user-detail/detail-form/detail-form.component.html +++ b/console/src/app/pages/users/user-detail/detail-form/detail-form.component.html @@ -1,56 +1,61 @@
-
+
+
- {{ 'USER.PROFILE.USERNAME' | translate }} - + {{ 'USER.PROFILE.USERNAME' | translate }} + +
- - {{ 'USER.PROFILE.FIRSTNAME' | translate }} - - - - {{ 'USER.PROFILE.LASTNAME' | translate }} - - - - {{ 'USER.PROFILE.NICKNAME' | translate }} - - - - {{ 'USER.PROFILE.DISPLAYNAME' | translate }} - - - - {{ 'USER.PROFILE.GENDER' | translate }} - - - {{ 'GENDERS.'+gender | translate }} - - - - - {{ 'USER.PROFILE.PREFERRED_LANGUAGE' | translate }} - - - {{ 'LANGUAGES.'+language | translate }} - - - -
-
-
+ + {{ 'USER.PROFILE.FIRSTNAME' | translate }} + + + + {{ 'USER.PROFILE.LASTNAME' | translate }} + + + + {{ 'USER.PROFILE.NICKNAME' | translate }} + + + + {{ 'USER.PROFILE.DISPLAYNAME' | translate }} + + + + {{ 'USER.PROFILE.GENDER' | translate }} + + + {{ 'GENDERS.'+gender | translate }} + + + + + {{ 'USER.PROFILE.PREFERRED_LANGUAGE' | translate }} + + + {{ 'LANGUAGES.'+language | translate }} + + + +
+
+ +
\ No newline at end of file diff --git a/console/src/app/pages/users/user-detail/detail-form/detail-form.component.scss b/console/src/app/pages/users/user-detail/detail-form/detail-form.component.scss index 330dfbaf19..819ef62d9f 100644 --- a/console/src/app/pages/users/user-detail/detail-form/detail-form.component.scss +++ b/console/src/app/pages/users/user-detail/detail-form/detail-form.component.scss @@ -7,6 +7,22 @@ &.inner { margin: 0; width: 100%; + display: flex; + align-items: center; + + .usernamediv { + margin-left: .5rem; + margin-bottom: .5rem; + + .formfield { + margin: 0; + flex: 1; + } + + .edit { + cursor: pointer !important; + } + } } .camera-wrapper { diff --git a/console/src/app/pages/users/user-detail/detail-form/detail-form.component.ts b/console/src/app/pages/users/user-detail/detail-form/detail-form.component.ts index d61e9003d8..55788d632e 100644 --- a/console/src/app/pages/users/user-detail/detail-form/detail-form.component.ts +++ b/console/src/app/pages/users/user-detail/detail-form/detail-form.component.ts @@ -21,7 +21,8 @@ export class DetailFormComponent implements OnDestroy, OnChanges { @Input() public languages: string[] = ['de', 'en']; @Output() public submitData: EventEmitter = new EventEmitter(); @Output() public changedLanguage: EventEmitter = new EventEmitter(); - + @Output() public changeUsernameClicked: EventEmitter = new EventEmitter(); + public profileForm!: FormGroup; private sub: Subscription = new Subscription(); @@ -73,6 +74,10 @@ export class DetailFormComponent implements OnDestroy, OnChanges { this.submitData.emit(this.profileForm.value); } + public changeUsername(): void { + this.changeUsernameClicked.emit(); + } + public openUploadDialog(): void { const dialogRef = this.dialog.open(ProfilePictureComponent, { data: { diff --git a/console/src/app/pages/users/user-detail/user-detail/user-detail.component.html b/console/src/app/pages/users/user-detail/user-detail/user-detail.component.html index 238aa1687a..12056c840d 100644 --- a/console/src/app/pages/users/user-detail/user-detail/user-detail.component.html +++ b/console/src/app/pages/users/user-detail/user-detail/user-detail.component.html @@ -48,7 +48,7 @@ + (submitData)="saveProfile($event)" (changeUsernameClicked)="changeUsername()"> diff --git a/console/src/app/pages/users/user-detail/user-detail/user-detail.component.ts b/console/src/app/pages/users/user-detail/user-detail/user-detail.component.ts index f35306e465..42a174487f 100644 --- a/console/src/app/pages/users/user-detail/user-detail/user-detail.component.ts +++ b/console/src/app/pages/users/user-detail/user-detail/user-detail.component.ts @@ -49,28 +49,34 @@ export class UserDetailComponent implements OnInit { private _location: Location, private dialog: MatDialog, private router: Router, - ) { } + ) {} refreshUser(): void { this.refreshChanges$.emit(); - this.route.params.pipe(take(1)).subscribe(params => { + this.route.params.pipe(take(1)).subscribe((params) => { const { id } = params; - this.mgmtUserService.getUserByID(id).then(resp => { - if (resp.user) { - this.user = resp.user; - } - }).catch(err => { - this.error = err.message ?? ''; - this.toast.showError(err); - }); + this.mgmtUserService + .getUserByID(id) + .then((resp) => { + if (resp.user) { + this.user = resp.user; + } + }) + .catch((err) => { + this.error = err.message ?? ''; + this.toast.showError(err); + }); - this.mgmtUserService.listUserMetadata(id, 0, 100, []).then(resp => { - if (resp.resultList) { - this.metadata = resp.resultList; - } - }).catch(err => { - console.error(err); - }); + this.mgmtUserService + .listUserMetadata(id, 0, 100, []) + .then((resp) => { + if (resp.resultList) { + this.metadata = resp.resultList; + } + }) + .catch((err) => { + console.error(err); + }); }); } @@ -78,32 +84,69 @@ export class UserDetailComponent implements OnInit { this.refreshUser(); } + public changeUsername(): void { + const dialogRefPhone = this.dialog.open(EditDialogComponent, { + data: { + confirmKey: 'ACTIONS.CHANGE', + cancelKey: 'ACTIONS.CANCEL', + labelKey: 'ACTIONS.NEWVALUE', + titleKey: 'USER.PROFILE.CHANGEUSERNAME_TITLE', + descriptionKey: 'USER.PROFILE.CHANGEUSERNAME_DESC', + value: this.user.userName, + }, + width: '400px', + }); + + dialogRefPhone.afterClosed().subscribe((resp) => { + if (resp && resp !== this.user.userName) { + this.mgmtUserService + .updateUserName(this.user.id, resp) + .then(() => { + this.toast.showInfo('USER.TOAST.USERNAMECHANGED', true); + this.refreshUser(); + }) + .catch((error) => { + this.toast.showError(error); + }); + } + }); + } + public unlockUser(): void { const req = new UnlockUserRequest(); req.setId(this.user.id); - this.mgmtUserService.unlockUser(req).then(() => { - this.toast.showInfo('USER.TOAST.UNLOCKED', true); - this.refreshUser(); - }).catch(error => { - this.toast.showError(error); - }); + this.mgmtUserService + .unlockUser(req) + .then(() => { + this.toast.showInfo('USER.TOAST.UNLOCKED', true); + this.refreshUser(); + }) + .catch((error) => { + this.toast.showError(error); + }); } public changeState(newState: UserState): void { if (newState === UserState.USER_STATE_ACTIVE) { - this.mgmtUserService.reactivateUser(this.user.id).then(() => { - this.toast.showInfo('USER.TOAST.REACTIVATED', true); - this.user.state = newState; - }).catch(error => { - this.toast.showError(error); - }); + this.mgmtUserService + .reactivateUser(this.user.id) + .then(() => { + this.toast.showInfo('USER.TOAST.REACTIVATED', true); + this.user.state = newState; + }) + .catch((error) => { + this.toast.showError(error); + }); } else if (newState === UserState.USER_STATE_INACTIVE) { - this.mgmtUserService.deactivateUser(this.user.id).then(() => { - this.toast.showInfo('USER.TOAST.DEACTIVATED', true); - this.user.state = newState; - }).catch(error => { - this.toast.showError(error); - }); + this.mgmtUserService + .deactivateUser(this.user.id) + .then(() => { + this.toast.showInfo('USER.TOAST.DEACTIVATED', true); + this.user.state = newState; + }) + .catch((error) => { + this.toast.showError(error); + }); } } @@ -118,12 +161,13 @@ export class UserDetailComponent implements OnInit { this.user.human.profile.nickName, this.user.human.profile.displayName, this.user.human.profile.preferredLanguage, - this.user.human.profile.gender) + this.user.human.profile.gender, + ) .then(() => { this.toast.showInfo('USER.TOAST.SAVED', true); this.refreshChanges$.emit(); }) - .catch(error => { + .catch((error) => { this.toast.showError(error); }); } @@ -135,82 +179,96 @@ export class UserDetailComponent implements OnInit { this.user.machine.description = machineData.description; this.mgmtUserService - .updateMachine( - this.user.id, - this.user.machine.name, - this.user.machine.description) + .updateMachine(this.user.id, this.user.machine.name, this.user.machine.description) .then(() => { this.toast.showInfo('USER.TOAST.SAVED', true); this.refreshChanges$.emit(); }) - .catch(error => { + .catch((error) => { this.toast.showError(error); }); } } public resendEmailVerification(): void { - this.mgmtUserService.resendHumanEmailVerification(this.user.id).then(() => { - this.toast.showInfo('USER.TOAST.EMAILVERIFICATIONSENT', true); - this.refreshChanges$.emit(); - }).catch(error => { - this.toast.showError(error); - }); + this.mgmtUserService + .resendHumanEmailVerification(this.user.id) + .then(() => { + this.toast.showInfo('USER.TOAST.EMAILVERIFICATIONSENT', true); + this.refreshChanges$.emit(); + }) + .catch((error) => { + this.toast.showError(error); + }); } public resendPhoneVerification(): void { - this.mgmtUserService.resendHumanPhoneVerification(this.user.id).then(() => { - this.toast.showInfo('USER.TOAST.PHONEVERIFICATIONSENT', true); - this.refreshChanges$.emit(); - }).catch(error => { - this.toast.showError(error); - }); + this.mgmtUserService + .resendHumanPhoneVerification(this.user.id) + .then(() => { + this.toast.showInfo('USER.TOAST.PHONEVERIFICATIONSENT', true); + this.refreshChanges$.emit(); + }) + .catch((error) => { + this.toast.showError(error); + }); } public deletePhone(): void { - this.mgmtUserService.removeHumanPhone(this.user.id).then(() => { - this.toast.showInfo('USER.TOAST.PHONEREMOVED', true); - if (this.user.human) { - this.user.human.phone = new Phone().setPhone('').toObject(); - this.refreshUser(); - } - }).catch(error => { - this.toast.showError(error); - }); + this.mgmtUserService + .removeHumanPhone(this.user.id) + .then(() => { + this.toast.showInfo('USER.TOAST.PHONEREMOVED', true); + if (this.user.human) { + this.user.human.phone = new Phone().setPhone('').toObject(); + this.refreshUser(); + } + }) + .catch((error) => { + this.toast.showError(error); + }); } public saveEmail(email: string): void { if (this.user.id && email) { - this.mgmtUserService.updateHumanEmail(this.user.id, email).then(() => { - this.toast.showInfo('USER.TOAST.EMAILSAVED', true); - if (this.user.state === UserState.USER_STATE_INITIAL) { - this.mgmtUserService.resendHumanInitialization(this.user.id, email ?? '').then(() => { - this.toast.showInfo('USER.TOAST.INITEMAILSENT', true); - this.refreshChanges$.emit(); - }).catch(error => { - this.toast.showError(error); - }); - } - if (this.user.human) { - this.user.human.email = new Email().setEmail(email).toObject(); - this.refreshUser(); - } - }).catch(error => { - this.toast.showError(error); - }); + this.mgmtUserService + .updateHumanEmail(this.user.id, email) + .then(() => { + this.toast.showInfo('USER.TOAST.EMAILSAVED', true); + if (this.user.state === UserState.USER_STATE_INITIAL) { + this.mgmtUserService + .resendHumanInitialization(this.user.id, email ?? '') + .then(() => { + this.toast.showInfo('USER.TOAST.INITEMAILSENT', true); + this.refreshChanges$.emit(); + }) + .catch((error) => { + this.toast.showError(error); + }); + } + if (this.user.human) { + this.user.human.email = new Email().setEmail(email).toObject(); + this.refreshUser(); + } + }) + .catch((error) => { + this.toast.showError(error); + }); } } public savePhone(phone: string): void { if (this.user.id && phone) { this.mgmtUserService - .updateHumanPhone(this.user.id, phone).then(() => { + .updateHumanPhone(this.user.id, phone) + .then(() => { this.toast.showInfo('USER.TOAST.PHONESAVED', true); if (this.user.human) { this.user.human.phone = new Phone().setPhone(phone).toObject(); this.refreshUser(); } - }).catch(error => { + }) + .catch((error) => { this.toast.showError(error); }); } @@ -221,15 +279,15 @@ export class UserDetailComponent implements OnInit { } public sendSetPasswordNotification(): void { - this.mgmtUserService.sendHumanResetPasswordNotification( - this.user.id, - SendHumanResetPasswordNotificationRequest.Type.TYPE_EMAIL, - ).then(() => { - this.toast.showInfo('USER.TOAST.PASSWORDNOTIFICATIONSENT', true); - this.refreshChanges$.emit(); - }).catch(error => { - this.toast.showError(error); - }); + this.mgmtUserService + .sendHumanResetPasswordNotification(this.user.id, SendHumanResetPasswordNotificationRequest.Type.TYPE_EMAIL) + .then(() => { + this.toast.showInfo('USER.TOAST.PASSWORDNOTIFICATIONSENT', true); + this.refreshChanges$.emit(); + }) + .catch((error) => { + this.toast.showError(error); + }); } public deleteUser(): void { @@ -243,17 +301,20 @@ export class UserDetailComponent implements OnInit { width: '400px', }); - dialogRef.afterClosed().subscribe(resp => { + dialogRef.afterClosed().subscribe((resp) => { if (resp) { - this.mgmtUserService.removeUser(this.user.id).then(() => { - const params: Params = { - 'deferredReload': true, - }; - this.router.navigate(['/users/list', this.user.human ? 'humans' : 'machines'], { queryParams: params }); - this.toast.showInfo('USER.TOAST.DELETED', true); - }).catch(error => { - this.toast.showError(error); - }); + this.mgmtUserService + .removeUser(this.user.id) + .then(() => { + const params: Params = { + deferredReload: true, + }; + this.router.navigate(['/users/list', this.user.human ? 'humans' : 'machines'], { queryParams: params }); + this.toast.showInfo('USER.TOAST.DELETED', true); + }) + .catch((error) => { + this.toast.showError(error); + }); } }); } @@ -263,14 +324,17 @@ export class UserDetailComponent implements OnInit { width: '400px', }); - dialogRef.afterClosed().subscribe(resp => { + dialogRef.afterClosed().subscribe((resp) => { if (resp.send && this.user.id) { - this.mgmtUserService.resendHumanInitialization(this.user.id, resp.email ?? '').then(() => { - this.toast.showInfo('USER.TOAST.INITEMAILSENT', true); - this.refreshChanges$.emit(); - }).catch(error => { - this.toast.showError(error); - }); + this.mgmtUserService + .resendHumanInitialization(this.user.id, resp.email ?? '') + .then(() => { + this.toast.showInfo('USER.TOAST.INITEMAILSENT', true); + this.refreshChanges$.emit(); + }) + .catch((error) => { + this.toast.showError(error); + }); } }); } @@ -291,7 +355,7 @@ export class UserDetailComponent implements OnInit { width: '400px', }); - dialogRefPhone.afterClosed().subscribe(resp => { + dialogRefPhone.afterClosed().subscribe((resp) => { if (resp) { this.savePhone(resp); } @@ -311,7 +375,7 @@ export class UserDetailComponent implements OnInit { width: '400px', }); - dialogRefEmail.afterClosed().subscribe(resp => { + dialogRefEmail.afterClosed().subscribe((resp) => { if (resp) { this.saveEmail(resp); } diff --git a/console/src/app/services/grpc-auth.service.ts b/console/src/app/services/grpc-auth.service.ts index a857c07cc8..223bc9ef08 100644 --- a/console/src/app/services/grpc-auth.service.ts +++ b/console/src/app/services/grpc-auth.service.ts @@ -68,6 +68,8 @@ import { UpdateMyPasswordResponse, UpdateMyProfileRequest, UpdateMyProfileResponse, + UpdateMyUserNameRequest, + UpdateMyUserNameResponse, VerifyMyAuthFactorOTPRequest, VerifyMyAuthFactorOTPResponse, VerifyMyAuthFactorU2FRequest, @@ -407,6 +409,12 @@ export class GrpcAuthService { ).then(resp => resp.toObject()); } + public updateMyUserName(username: string): Promise { + const req = new UpdateMyUserNameRequest(); + req.setUserName(username); + return this.grpcService.auth.updateMyUserName(req, null).then(resp => resp.toObject()); + } + public listMyZitadelPermissions(): Promise { return this.grpcService.auth.listMyZitadelPermissions( new ListMyZitadelPermissionsRequest(), null, diff --git a/console/src/app/services/grpc.service.ts b/console/src/app/services/grpc.service.ts index f5d28831aa..d851d397e7 100644 --- a/console/src/app/services/grpc.service.ts +++ b/console/src/app/services/grpc.service.ts @@ -27,11 +27,13 @@ export class GrpcService { private authenticationService: AuthenticationService, private storageService: StorageService, private dialog: MatDialog, - ) { } + ) {} public async loadAppEnvironment(): Promise { - return this.http.get('./assets/environment.json') - .toPromise().then((data: any) => { + return this.http + .get('./assets/environment.json') + .toPromise() + .then((data: any) => { if (data && data.authServiceUrl && data.mgmtServiceUrl && data.issuer) { const interceptors = { unaryInterceptors: [ @@ -74,7 +76,8 @@ export class GrpcService { this.authenticationService.initConfig(authConfig); } return Promise.resolve(data); - }).catch(() => { + }) + .catch(() => { console.error('Failed to load environment from assets'); }); } diff --git a/console/src/app/services/mgmt.service.ts b/console/src/app/services/mgmt.service.ts index b730b0b029..dbe917391f 100644 --- a/console/src/app/services/mgmt.service.ts +++ b/console/src/app/services/mgmt.service.ts @@ -394,6 +394,8 @@ import { UpdateProjectRoleResponse, UpdateUserGrantRequest, UpdateUserGrantResponse, + UpdateUserNameRequest, + UpdateUserNameResponse, ValidateOrgDomainRequest, ValidateOrgDomainResponse, } from '../proto/generated/zitadel/management_pb'; @@ -421,177 +423,188 @@ export class ManagementService { public ownedProjectsCount: BehaviorSubject = new BehaviorSubject(0); public grantedProjectsCount: BehaviorSubject = new BehaviorSubject(0); - constructor(private readonly grpcService: GrpcService) { } + constructor(private readonly grpcService: GrpcService) {} public getSupportedLanguages(): Promise { const req = new GetSupportedLanguagesRequest(); - return this.grpcService.mgmt.getSupportedLanguages(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getSupportedLanguages(req, null).then((resp) => resp.toObject()); } public getDefaultLoginTexts(req: GetDefaultLoginTextsRequest): Promise { - return this.grpcService.mgmt.getDefaultLoginTexts(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getDefaultLoginTexts(req, null).then((resp) => resp.toObject()); } public getCustomLoginTexts(req: GetCustomLoginTextsRequest): Promise { - return this.grpcService.mgmt.getCustomLoginTexts(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getCustomLoginTexts(req, null).then((resp) => resp.toObject()); } public setCustomLoginText(req: SetCustomLoginTextsRequest): Promise { - return this.grpcService.mgmt.setCustomLoginText(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.setCustomLoginText(req, null).then((resp) => resp.toObject()); } public resetCustomLoginTextToDefault(lang: string): Promise { const req = new ResetCustomLoginTextsToDefaultRequest(); req.setLanguage(lang); - return this.grpcService.mgmt.resetCustomLoginTextToDefault(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.resetCustomLoginTextToDefault(req, null).then((resp) => resp.toObject()); } // message texts - public getDefaultInitMessageText(req: GetDefaultInitMessageTextRequest): - Promise { - return this.grpcService.mgmt.getDefaultInitMessageText(req, null).then(resp => resp.toObject()); + public getDefaultInitMessageText( + req: GetDefaultInitMessageTextRequest, + ): Promise { + return this.grpcService.mgmt.getDefaultInitMessageText(req, null).then((resp) => resp.toObject()); } - public getCustomInitMessageText(req: GetCustomInitMessageTextRequest): - Promise { - return this.grpcService.mgmt.getCustomInitMessageText(req, null).then(resp => resp.toObject()); + public getCustomInitMessageText(req: GetCustomInitMessageTextRequest): Promise { + return this.grpcService.mgmt.getCustomInitMessageText(req, null).then((resp) => resp.toObject()); } - public setCustomInitMessageText(req: SetCustomInitMessageTextRequest): - Promise { - return this.grpcService.mgmt.setCustomInitMessageText(req, null).then(resp => resp.toObject()); + public setCustomInitMessageText(req: SetCustomInitMessageTextRequest): Promise { + return this.grpcService.mgmt.setCustomInitMessageText(req, null).then((resp) => resp.toObject()); } - public resetCustomInitMessageTextToDefault(lang: string): - Promise { + public resetCustomInitMessageTextToDefault(lang: string): Promise { const req = new ResetCustomInitMessageTextToDefaultRequest(); req.setLanguage(lang); - return this.grpcService.mgmt.resetCustomInitMessageTextToDefault(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.resetCustomInitMessageTextToDefault(req, null).then((resp) => resp.toObject()); } - - - public getDefaultVerifyEmailMessageText(req: GetDefaultVerifyEmailMessageTextRequest): - Promise { - return this.grpcService.mgmt.getDefaultVerifyEmailMessageText(req, null).then(resp => resp.toObject()); + public getDefaultVerifyEmailMessageText( + req: GetDefaultVerifyEmailMessageTextRequest, + ): Promise { + return this.grpcService.mgmt.getDefaultVerifyEmailMessageText(req, null).then((resp) => resp.toObject()); } - public getCustomVerifyEmailMessageText(req: GetCustomVerifyEmailMessageTextRequest): - Promise { - return this.grpcService.mgmt.getCustomVerifyEmailMessageText(req, null).then(resp => resp.toObject()); + public getCustomVerifyEmailMessageText( + req: GetCustomVerifyEmailMessageTextRequest, + ): Promise { + return this.grpcService.mgmt.getCustomVerifyEmailMessageText(req, null).then((resp) => resp.toObject()); } - public setCustomVerifyEmailMessageText(req: SetCustomVerifyEmailMessageTextRequest): - Promise { - return this.grpcService.mgmt.setCustomVerifyEmailMessageText(req, null).then(resp => resp.toObject()); + public setCustomVerifyEmailMessageText( + req: SetCustomVerifyEmailMessageTextRequest, + ): Promise { + return this.grpcService.mgmt.setCustomVerifyEmailMessageText(req, null).then((resp) => resp.toObject()); } - public resetCustomVerifyEmailMessageTextToDefault(lang: string): - Promise { + public resetCustomVerifyEmailMessageTextToDefault( + lang: string, + ): Promise { const req = new ResetCustomVerifyEmailMessageTextToDefaultRequest(); req.setLanguage(lang); - return this.grpcService.mgmt.resetCustomVerifyEmailMessageTextToDefault(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.resetCustomVerifyEmailMessageTextToDefault(req, null).then((resp) => resp.toObject()); } - - public getDefaultVerifyPhoneMessageText(req: GetDefaultVerifyPhoneMessageTextRequest): - Promise { - return this.grpcService.mgmt.getDefaultVerifyPhoneMessageText(req, null).then(resp => resp.toObject()); + public getDefaultVerifyPhoneMessageText( + req: GetDefaultVerifyPhoneMessageTextRequest, + ): Promise { + return this.grpcService.mgmt.getDefaultVerifyPhoneMessageText(req, null).then((resp) => resp.toObject()); } - public getCustomVerifyPhoneMessageText(req: GetCustomVerifyPhoneMessageTextRequest): - Promise { - return this.grpcService.mgmt.getCustomVerifyPhoneMessageText(req, null).then(resp => resp.toObject()); + public getCustomVerifyPhoneMessageText( + req: GetCustomVerifyPhoneMessageTextRequest, + ): Promise { + return this.grpcService.mgmt.getCustomVerifyPhoneMessageText(req, null).then((resp) => resp.toObject()); } - public setCustomVerifyPhoneMessageText(req: SetCustomVerifyPhoneMessageTextRequest): - Promise { - return this.grpcService.mgmt.setCustomVerifyPhoneMessageText(req, null).then(resp => resp.toObject()); + public setCustomVerifyPhoneMessageText( + req: SetCustomVerifyPhoneMessageTextRequest, + ): Promise { + return this.grpcService.mgmt.setCustomVerifyPhoneMessageText(req, null).then((resp) => resp.toObject()); } - public resetCustomVerifyPhoneMessageTextToDefault(lang: string): - Promise { + public resetCustomVerifyPhoneMessageTextToDefault( + lang: string, + ): Promise { const req = new ResetCustomVerifyPhoneMessageTextToDefaultRequest(); req.setLanguage(lang); - return this.grpcService.mgmt.resetCustomVerifyPhoneMessageTextToDefault(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.resetCustomVerifyPhoneMessageTextToDefault(req, null).then((resp) => resp.toObject()); } - - public getDefaultPasswordResetMessageText(req: GetDefaultPasswordResetMessageTextRequest): - Promise { - return this.grpcService.mgmt.getDefaultPasswordResetMessageText(req, null).then(resp => resp.toObject()); + public getDefaultPasswordResetMessageText( + req: GetDefaultPasswordResetMessageTextRequest, + ): Promise { + return this.grpcService.mgmt.getDefaultPasswordResetMessageText(req, null).then((resp) => resp.toObject()); } - public getCustomPasswordResetMessageText(req: GetCustomPasswordResetMessageTextRequest): - Promise { - return this.grpcService.mgmt.getCustomPasswordResetMessageText(req, null).then(resp => resp.toObject()); + public getCustomPasswordResetMessageText( + req: GetCustomPasswordResetMessageTextRequest, + ): Promise { + return this.grpcService.mgmt.getCustomPasswordResetMessageText(req, null).then((resp) => resp.toObject()); } - public setCustomPasswordResetMessageText(req: SetCustomPasswordResetMessageTextRequest): - Promise { - return this.grpcService.mgmt.setCustomPasswordResetMessageText(req, null).then(resp => resp.toObject()); + public setCustomPasswordResetMessageText( + req: SetCustomPasswordResetMessageTextRequest, + ): Promise { + return this.grpcService.mgmt.setCustomPasswordResetMessageText(req, null).then((resp) => resp.toObject()); } - public resetCustomPasswordResetMessageTextToDefault(lang: string): - Promise { + public resetCustomPasswordResetMessageTextToDefault( + lang: string, + ): Promise { const req = new ResetCustomPasswordResetMessageTextToDefaultRequest(); req.setLanguage(lang); - return this.grpcService.mgmt.resetCustomPasswordResetMessageTextToDefault(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.resetCustomPasswordResetMessageTextToDefault(req, null).then((resp) => resp.toObject()); } - - public getDefaultDomainClaimedMessageText(req: GetDefaultDomainClaimedMessageTextRequest): - Promise { - return this.grpcService.mgmt.getDefaultDomainClaimedMessageText(req, null).then(resp => resp.toObject()); + public getDefaultDomainClaimedMessageText( + req: GetDefaultDomainClaimedMessageTextRequest, + ): Promise { + return this.grpcService.mgmt.getDefaultDomainClaimedMessageText(req, null).then((resp) => resp.toObject()); } - public getCustomDomainClaimedMessageText(req: GetCustomDomainClaimedMessageTextRequest): - Promise { - return this.grpcService.mgmt.getCustomDomainClaimedMessageText(req, null).then(resp => resp.toObject()); + public getCustomDomainClaimedMessageText( + req: GetCustomDomainClaimedMessageTextRequest, + ): Promise { + return this.grpcService.mgmt.getCustomDomainClaimedMessageText(req, null).then((resp) => resp.toObject()); } - public setCustomDomainClaimedMessageCustomText(req: SetCustomDomainClaimedMessageTextRequest): - Promise { - return this.grpcService.mgmt.setCustomDomainClaimedMessageCustomText(req, null).then(resp => resp.toObject()); + public setCustomDomainClaimedMessageCustomText( + req: SetCustomDomainClaimedMessageTextRequest, + ): Promise { + return this.grpcService.mgmt.setCustomDomainClaimedMessageCustomText(req, null).then((resp) => resp.toObject()); } - public resetCustomDomainClaimedMessageTextToDefault(lang: string): - Promise { + public resetCustomDomainClaimedMessageTextToDefault( + lang: string, + ): Promise { const req = new ResetCustomDomainClaimedMessageTextToDefaultRequest(); req.setLanguage(lang); - return this.grpcService.mgmt.resetCustomDomainClaimedMessageTextToDefault(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.resetCustomDomainClaimedMessageTextToDefault(req, null).then((resp) => resp.toObject()); } - - public getDefaultPasswordlessRegistrationMessageText(req: GetDefaultPasswordlessRegistrationMessageTextRequest): - Promise { - return this.grpcService.mgmt.getDefaultPasswordlessRegistrationMessageText(req, null).then(resp => resp.toObject()); + public getDefaultPasswordlessRegistrationMessageText( + req: GetDefaultPasswordlessRegistrationMessageTextRequest, + ): Promise { + return this.grpcService.mgmt.getDefaultPasswordlessRegistrationMessageText(req, null).then((resp) => resp.toObject()); } - public getCustomPasswordlessRegistrationMessageText(req: GetCustomPasswordlessRegistrationMessageTextRequest): - Promise { - return this.grpcService.mgmt.getCustomPasswordlessRegistrationMessageText(req, null).then(resp => resp.toObject()); + public getCustomPasswordlessRegistrationMessageText( + req: GetCustomPasswordlessRegistrationMessageTextRequest, + ): Promise { + return this.grpcService.mgmt.getCustomPasswordlessRegistrationMessageText(req, null).then((resp) => resp.toObject()); } - public setCustomPasswordlessRegistrationMessageCustomText(req: SetCustomPasswordlessRegistrationMessageTextRequest): - Promise { - return this.grpcService.mgmt.setCustomPasswordlessRegistrationMessageCustomText(req, null).then(resp => resp.toObject()); + public setCustomPasswordlessRegistrationMessageCustomText( + req: SetCustomPasswordlessRegistrationMessageTextRequest, + ): Promise { + return this.grpcService.mgmt + .setCustomPasswordlessRegistrationMessageCustomText(req, null) + .then((resp) => resp.toObject()); } - public resetCustomPasswordlessRegistrationMessageTextToDefault(lang: string): - Promise { + public resetCustomPasswordlessRegistrationMessageTextToDefault( + lang: string, + ): Promise { const req = new ResetCustomPasswordlessRegistrationMessageTextToDefaultRequest(); req.setLanguage(lang); - return this.grpcService.mgmt.resetCustomPasswordlessRegistrationMessageTextToDefault(req, null) - .then(resp => resp.toObject()); + return this.grpcService.mgmt + .resetCustomPasswordlessRegistrationMessageTextToDefault(req, null) + .then((resp) => resp.toObject()); } - public listOrgIDPs( - limit?: number, - offset?: number, - queryList?: IDPQuery[], - ): Promise { + public listOrgIDPs(limit?: number, offset?: number, queryList?: IDPQuery[]): Promise { const req = new ListOrgIDPsRequest(); const metadata = new ListQuery(); @@ -604,115 +617,122 @@ export class ManagementService { if (queryList) { req.setQueriesList(queryList); } - return this.grpcService.mgmt.listOrgIDPs(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listOrgIDPs(req, null).then((resp) => resp.toObject()); } - public unlockUser(req: UnlockUserRequest): - Promise { - return this.grpcService.mgmt.unlockUser(req, null).then(resp => resp.toObject()); + public updateUserName(userId: string, username: string): Promise { + const req = new UpdateUserNameRequest(); + req.setUserId(userId); + req.setUserName(username); + return this.grpcService.mgmt.updateUserName(req, null).then((resp) => resp.toObject()); } - public getPrivacyPolicy(): - Promise { + public unlockUser(req: UnlockUserRequest): Promise { + return this.grpcService.mgmt.unlockUser(req, null).then((resp) => resp.toObject()); + } + + public getPrivacyPolicy(): Promise { const req = new GetPrivacyPolicyRequest(); - return this.grpcService.mgmt.getPrivacyPolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getPrivacyPolicy(req, null).then((resp) => resp.toObject()); } - public addCustomPrivacyPolicy(req: AddCustomPrivacyPolicyRequest): - Promise { - return this.grpcService.mgmt.addCustomPrivacyPolicy(req, null).then(resp => resp.toObject()); + public addCustomPrivacyPolicy(req: AddCustomPrivacyPolicyRequest): Promise { + return this.grpcService.mgmt.addCustomPrivacyPolicy(req, null).then((resp) => resp.toObject()); } - public updateCustomPrivacyPolicy(req: UpdateCustomPrivacyPolicyRequest): - Promise { - return this.grpcService.mgmt.updateCustomPrivacyPolicy(req, null).then(resp => resp.toObject()); + public updateCustomPrivacyPolicy( + req: UpdateCustomPrivacyPolicyRequest, + ): Promise { + return this.grpcService.mgmt.updateCustomPrivacyPolicy(req, null).then((resp) => resp.toObject()); } - public resetPrivacyPolicyToDefault(): - Promise { + public resetPrivacyPolicyToDefault(): Promise { const req = new ResetPrivacyPolicyToDefaultRequest(); - return this.grpcService.mgmt.resetPrivacyPolicyToDefault(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.resetPrivacyPolicyToDefault(req, null).then((resp) => resp.toObject()); } public listHumanPasswordless(userId: string): Promise { const req = new ListHumanPasswordlessRequest(); req.setUserId(userId); - return this.grpcService.mgmt.listHumanPasswordless(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listHumanPasswordless(req, null).then((resp) => resp.toObject()); } public removeHumanPasswordless(tokenId: string, userId: string): Promise { const req = new RemoveHumanPasswordlessRequest(); req.setTokenId(tokenId); req.setUserId(userId); - return this.grpcService.mgmt.removeHumanPasswordless(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeHumanPasswordless(req, null).then((resp) => resp.toObject()); } public sendPasswordlessRegistration(userId: string): Promise { const req = new SendPasswordlessRegistrationRequest(); req.setUserId(userId); - return this.grpcService.mgmt.sendPasswordlessRegistration(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.sendPasswordlessRegistration(req, null).then((resp) => resp.toObject()); } public listLoginPolicyMultiFactors(): Promise { const req = new ListLoginPolicyMultiFactorsRequest(); - return this.grpcService.mgmt.listLoginPolicyMultiFactors(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listLoginPolicyMultiFactors(req, null).then((resp) => resp.toObject()); } - public addMultiFactorToLoginPolicy(req: AddMultiFactorToLoginPolicyRequest): - Promise { - return this.grpcService.mgmt.addMultiFactorToLoginPolicy(req, null).then(resp => resp.toObject()); + public addMultiFactorToLoginPolicy( + req: AddMultiFactorToLoginPolicyRequest, + ): Promise { + return this.grpcService.mgmt.addMultiFactorToLoginPolicy(req, null).then((resp) => resp.toObject()); } - public removeMultiFactorFromLoginPolicy(req: RemoveMultiFactorFromLoginPolicyRequest): - Promise { - return this.grpcService.mgmt.removeMultiFactorFromLoginPolicy(req, null).then(resp => resp.toObject()); + public removeMultiFactorFromLoginPolicy( + req: RemoveMultiFactorFromLoginPolicyRequest, + ): Promise { + return this.grpcService.mgmt.removeMultiFactorFromLoginPolicy(req, null).then((resp) => resp.toObject()); } public listLoginPolicySecondFactors(): Promise { const req = new Empty(); - return this.grpcService.mgmt.listLoginPolicySecondFactors(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listLoginPolicySecondFactors(req, null).then((resp) => resp.toObject()); } - public addSecondFactorToLoginPolicy(req: AddSecondFactorToLoginPolicyRequest): - Promise { - return this.grpcService.mgmt.addSecondFactorToLoginPolicy(req, null).then(resp => resp.toObject()); + public addSecondFactorToLoginPolicy( + req: AddSecondFactorToLoginPolicyRequest, + ): Promise { + return this.grpcService.mgmt.addSecondFactorToLoginPolicy(req, null).then((resp) => resp.toObject()); } - public removeSecondFactorFromLoginPolicy(req: RemoveSecondFactorFromLoginPolicyRequest): - Promise { - return this.grpcService.mgmt.removeSecondFactorFromLoginPolicy(req, null).then(resp => resp.toObject()); + public removeSecondFactorFromLoginPolicy( + req: RemoveSecondFactorFromLoginPolicyRequest, + ): Promise { + return this.grpcService.mgmt.removeSecondFactorFromLoginPolicy(req, null).then((resp) => resp.toObject()); } public getLoginPolicy(): Promise { const req = new GetLoginPolicyRequest(); - return this.grpcService.mgmt.getLoginPolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getLoginPolicy(req, null).then((resp) => resp.toObject()); } - public updateCustomLoginPolicy(req: UpdateCustomLoginPolicyRequest): - Promise { - return this.grpcService.mgmt.updateCustomLoginPolicy(req, null).then(resp => resp.toObject()); + public updateCustomLoginPolicy(req: UpdateCustomLoginPolicyRequest): Promise { + return this.grpcService.mgmt.updateCustomLoginPolicy(req, null).then((resp) => resp.toObject()); } public addCustomLoginPolicy(req: AddCustomLoginPolicyRequest): Promise { - return this.grpcService.mgmt.addCustomLoginPolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.addCustomLoginPolicy(req, null).then((resp) => resp.toObject()); } public resetLoginPolicyToDefault(): Promise { const req = new ResetLoginPolicyToDefaultRequest(); - return this.grpcService.mgmt.resetLoginPolicyToDefault(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.resetLoginPolicyToDefault(req, null).then((resp) => resp.toObject()); } public addIDPToLoginPolicy(idpId: string, ownerType: IDPOwnerType): Promise { const req = new AddIDPToLoginPolicyRequest(); req.setIdpId(idpId); req.setOwnertype(ownerType); - return this.grpcService.mgmt.addIDPToLoginPolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.addIDPToLoginPolicy(req, null).then((resp) => resp.toObject()); } public removeIDPFromLoginPolicy(idpId: string): Promise { const req = new RemoveIDPFromLoginPolicyRequest(); req.setIdpId(idpId); - return this.grpcService.mgmt.removeIDPFromLoginPolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeIDPFromLoginPolicy(req, null).then((resp) => resp.toObject()); } public listLoginPolicyIDPs(limit?: number, offset?: number): Promise { @@ -724,84 +744,62 @@ export class ManagementService { if (offset) { metadata.setOffset(offset); } - return this.grpcService.mgmt.listLoginPolicyIDPs(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listLoginPolicyIDPs(req, null).then((resp) => resp.toObject()); } - public getOrgIDPByID( - id: string, - ): Promise { + public getOrgIDPByID(id: string): Promise { const req = new GetOrgIDPByIDRequest(); req.setId(id); - return this.grpcService.mgmt.getOrgIDPByID(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getOrgIDPByID(req, null).then((resp) => resp.toObject()); } - public updateOrgIDP( - req: UpdateOrgIDPRequest, - ): Promise { - return this.grpcService.mgmt.updateOrgIDP(req, null).then(resp => resp.toObject()); + public updateOrgIDP(req: UpdateOrgIDPRequest): Promise { + return this.grpcService.mgmt.updateOrgIDP(req, null).then((resp) => resp.toObject()); } - public addOrgOIDCIDP( - req: AddOrgOIDCIDPRequest, - ): Promise { - return this.grpcService.mgmt.addOrgOIDCIDP(req, null).then(resp => resp.toObject()); + public addOrgOIDCIDP(req: AddOrgOIDCIDPRequest): Promise { + return this.grpcService.mgmt.addOrgOIDCIDP(req, null).then((resp) => resp.toObject()); } - public updateOrgIDPOIDCConfig( - req: UpdateOrgIDPOIDCConfigRequest, - ): Promise { - return this.grpcService.mgmt.updateOrgIDPOIDCConfig(req, null).then(resp => resp.toObject()); + public updateOrgIDPOIDCConfig(req: UpdateOrgIDPOIDCConfigRequest): Promise { + return this.grpcService.mgmt.updateOrgIDPOIDCConfig(req, null).then((resp) => resp.toObject()); } - public removeOrgIDP( - idpId: string, - ): Promise { + public removeOrgIDP(idpId: string): Promise { const req = new RemoveOrgIDPRequest(); req.setIdpId(idpId); - return this.grpcService.mgmt.removeOrgIDP(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeOrgIDP(req, null).then((resp) => resp.toObject()); } - public deactivateOrgIDP( - idpId: string, - ): Promise { + public deactivateOrgIDP(idpId: string): Promise { const req = new DeactivateOrgIDPRequest(); req.setIdpId(idpId); - return this.grpcService.mgmt.deactivateOrgIDP(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.deactivateOrgIDP(req, null).then((resp) => resp.toObject()); } - public reactivateOrgIDP( - idpId: string, - ): Promise { + public reactivateOrgIDP(idpId: string): Promise { const req = new ReactivateOrgIDPRequest(); req.setIdpId(idpId); - return this.grpcService.mgmt.reactivateOrgIDP(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.reactivateOrgIDP(req, null).then((resp) => resp.toObject()); } - public addOrgJWTIDP( - req: AddOrgJWTIDPRequest, - ): Promise { - return this.grpcService.mgmt.addOrgJWTIDP(req, null).then(resp => resp.toObject()); + public addOrgJWTIDP(req: AddOrgJWTIDPRequest): Promise { + return this.grpcService.mgmt.addOrgJWTIDP(req, null).then((resp) => resp.toObject()); } - public updateOrgIDPJWTConfig( - req: UpdateOrgIDPJWTConfigRequest, - ): Promise { - return this.grpcService.mgmt.updateOrgIDPJWTConfig(req, null).then(resp => resp.toObject()); + public updateOrgIDPJWTConfig(req: UpdateOrgIDPJWTConfigRequest): Promise { + return this.grpcService.mgmt.updateOrgIDPJWTConfig(req, null).then((resp) => resp.toObject()); } public addHumanUser(req: AddHumanUserRequest): Promise { - return this.grpcService.mgmt.addHumanUser(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.addHumanUser(req, null).then((resp) => resp.toObject()); } public addMachineUser(req: AddMachineUserRequest): Promise { - return this.grpcService.mgmt.addMachineUser(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.addMachineUser(req, null).then((resp) => resp.toObject()); } - public updateMachine( - userId: string, - name?: string, - description?: string, - ): Promise { + public updateMachine(userId: string, name?: string, description?: string): Promise { const req = new UpdateMachineRequest(); req.setUserId(userId); if (name) { @@ -810,32 +808,25 @@ export class ManagementService { if (description) { req.setDescription(description); } - return this.grpcService.mgmt.updateMachine(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.updateMachine(req, null).then((resp) => resp.toObject()); } - public addMachineKey( - userId: string, - type: KeyType, - date?: Timestamp, - ): Promise { + public addMachineKey(userId: string, type: KeyType, date?: Timestamp): Promise { const req = new AddMachineKeyRequest(); req.setType(type); req.setUserId(userId); if (date) { req.setExpirationDate(date); } - return this.grpcService.mgmt.addMachineKey(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.addMachineKey(req, null).then((resp) => resp.toObject()); } - public removeMachineKey( - keyId: string, - userId: string, - ): Promise { + public removeMachineKey(keyId: string, userId: string): Promise { const req = new RemoveMachineKeyRequest(); req.setKeyId(keyId); req.setUserId(userId); - return this.grpcService.mgmt.removeMachineKey(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeMachineKey(req, null).then((resp) => resp.toObject()); } public listMachineKeys( @@ -857,7 +848,7 @@ export class ManagementService { metadata.setAsc(asc); } req.setQuery(metadata); - return this.grpcService.mgmt.listMachineKeys(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listMachineKeys(req, null).then((resp) => resp.toObject()); } public removeHumanLinkedIDP( @@ -869,7 +860,7 @@ export class ManagementService { req.setIdpId(idpId); req.setUserId(userId); req.setLinkedUserId(linkedUserId); - return this.grpcService.mgmt.removeHumanLinkedIDP(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeHumanLinkedIDP(req, null).then((resp) => resp.toObject()); } public listHumanLinkedIDPs( @@ -887,67 +878,67 @@ export class ManagementService { metadata.setOffset(offset); } req.setQuery(metadata); - return this.grpcService.mgmt.listHumanLinkedIDPs(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listHumanLinkedIDPs(req, null).then((resp) => resp.toObject()); } public getIAM(): Promise { const req = new GetIAMRequest(); - return this.grpcService.mgmt.getIAM(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getIAM(req, null).then((resp) => resp.toObject()); } public getDefaultPasswordComplexityPolicy(): Promise { const req = new GetDefaultPasswordComplexityPolicyRequest(); - return this.grpcService.mgmt.getDefaultPasswordComplexityPolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getDefaultPasswordComplexityPolicy(req, null).then((resp) => resp.toObject()); } public getMyOrg(): Promise { const req = new GetMyOrgRequest(); - return this.grpcService.mgmt.getMyOrg(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getMyOrg(req, null).then((resp) => resp.toObject()); } public addOrgDomain(domain: string): Promise { const req = new AddOrgDomainRequest(); req.setDomain(domain); - return this.grpcService.mgmt.addOrgDomain(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.addOrgDomain(req, null).then((resp) => resp.toObject()); } public removeOrgDomain(domain: string): Promise { const req = new RemoveOrgDomainRequest(); req.setDomain(domain); - return this.grpcService.mgmt.removeOrgDomain(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeOrgDomain(req, null).then((resp) => resp.toObject()); } - public listOrgDomains(queryList?: DomainSearchQuery[]): - Promise { + public listOrgDomains(queryList?: DomainSearchQuery[]): Promise { const req: ListOrgDomainsRequest = new ListOrgDomainsRequest(); // const metadata= new ListQuery(); if (queryList) { req.setQueriesList(queryList); } - return this.grpcService.mgmt.listOrgDomains(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listOrgDomains(req, null).then((resp) => resp.toObject()); } public setPrimaryOrgDomain(domain: string): Promise { const req = new SetPrimaryOrgDomainRequest(); req.setDomain(domain); - return this.grpcService.mgmt.setPrimaryOrgDomain(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.setPrimaryOrgDomain(req, null).then((resp) => resp.toObject()); } - public generateOrgDomainValidation(domain: string, type: DomainValidationType): - Promise { + public generateOrgDomainValidation( + domain: string, + type: DomainValidationType, + ): Promise { const req: GenerateOrgDomainValidationRequest = new GenerateOrgDomainValidationRequest(); req.setDomain(domain); req.setType(type); - return this.grpcService.mgmt.generateOrgDomainValidation(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.generateOrgDomainValidation(req, null).then((resp) => resp.toObject()); } - public validateOrgDomain(domain: string): - Promise { + public validateOrgDomain(domain: string): Promise { const req = new ValidateOrgDomainRequest(); req.setDomain(domain); - return this.grpcService.mgmt.validateOrgDomain(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.validateOrgDomain(req, null).then((resp) => resp.toObject()); } public listOrgMembers(limit: number, offset: number): Promise { @@ -961,19 +952,19 @@ export class ManagementService { } req.setQuery(query); - return this.grpcService.mgmt.listOrgMembers(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listOrgMembers(req, null).then((resp) => resp.toObject()); } public getOrgByDomainGlobal(domain: string): Promise { const req = new GetOrgByDomainGlobalRequest(); req.setDomain(domain); - return this.grpcService.mgmt.getOrgByDomainGlobal(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getOrgByDomainGlobal(req, null).then((resp) => resp.toObject()); } public addOrg(name: string): Promise { const req = new AddOrgRequest(); req.setName(name); - return this.grpcService.mgmt.addOrg(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.addOrg(req, null).then((resp) => resp.toObject()); } public addOrgMember(userId: string, rolesList: string[]): Promise { @@ -982,31 +973,30 @@ export class ManagementService { if (rolesList) { req.setRolesList(rolesList); } - return this.grpcService.mgmt.addOrgMember(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.addOrgMember(req, null).then((resp) => resp.toObject()); } public updateOrgMember(userId: string, rolesList: string[]): Promise { const req = new UpdateOrgMemberRequest(); req.setUserId(userId); req.setRolesList(rolesList); - return this.grpcService.mgmt.updateOrgMember(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.updateOrgMember(req, null).then((resp) => resp.toObject()); } - public removeOrgMember(userId: string): Promise { const req = new RemoveOrgMemberRequest(); req.setUserId(userId); - return this.grpcService.mgmt.removeOrgMember(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeOrgMember(req, null).then((resp) => resp.toObject()); } public deactivateOrg(): Promise { const req = new DeactivateOrgRequest(); - return this.grpcService.mgmt.deactivateOrg(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.deactivateOrg(req, null).then((resp) => resp.toObject()); } public reactivateOrg(): Promise { const req = new ReactivateOrgRequest(); - return this.grpcService.mgmt.reactivateOrg(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.reactivateOrg(req, null).then((resp) => resp.toObject()); } public addProjectGrant( @@ -1018,96 +1008,87 @@ export class ManagementService { req.setProjectId(projectId); req.setGrantedOrgId(orgId); req.setRoleKeysList(roleKeysList); - return this.grpcService.mgmt.addProjectGrant(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.addProjectGrant(req, null).then((resp) => resp.toObject()); } public listOrgMemberRoles(): Promise { const req = new ListOrgMemberRolesRequest(); - return this.grpcService.mgmt.listOrgMemberRoles(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listOrgMemberRoles(req, null).then((resp) => resp.toObject()); } // Features public getFeatures(): Promise { const req = new GetFeaturesRequest(); - return this.grpcService.mgmt.getFeatures(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getFeatures(req, null).then((resp) => resp.toObject()); } // Policy public getLabelPolicy(): Promise { const req = new GetLabelPolicyRequest(); - return this.grpcService.mgmt.getLabelPolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getLabelPolicy(req, null).then((resp) => resp.toObject()); } - public updateCustomLabelPolicy(req: UpdateCustomLabelPolicyRequest): - Promise { - return this.grpcService.mgmt.updateCustomLabelPolicy(req, null).then(resp => resp.toObject()); + public updateCustomLabelPolicy(req: UpdateCustomLabelPolicyRequest): Promise { + return this.grpcService.mgmt.updateCustomLabelPolicy(req, null).then((resp) => resp.toObject()); } - public resetLabelPolicyToDefault(): - Promise { + public resetLabelPolicyToDefault(): Promise { const req = new ResetLabelPolicyToDefaultRequest(); - return this.grpcService.mgmt.resetLabelPolicyToDefault(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.resetLabelPolicyToDefault(req, null).then((resp) => resp.toObject()); } - public addCustomLabelPolicy(req: AddCustomLabelPolicyRequest): - Promise { - return this.grpcService.mgmt.addCustomLabelPolicy(req, null).then(resp => resp.toObject()); + public addCustomLabelPolicy(req: AddCustomLabelPolicyRequest): Promise { + return this.grpcService.mgmt.addCustomLabelPolicy(req, null).then((resp) => resp.toObject()); } public getDefaultLabelPolicy(req: GetDefaultLabelPolicyRequest): Promise { - return this.grpcService.mgmt.getDefaultLabelPolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getDefaultLabelPolicy(req, null).then((resp) => resp.toObject()); } public getPreviewLabelPolicy(): Promise { const req = new GetPreviewLabelPolicyRequest(); - return this.grpcService.mgmt.getPreviewLabelPolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getPreviewLabelPolicy(req, null).then((resp) => resp.toObject()); } - public activateCustomLabelPolicy(): - Promise { + public activateCustomLabelPolicy(): Promise { const req = new ActivateCustomLabelPolicyRequest(); - return this.grpcService.mgmt.activateCustomLabelPolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.activateCustomLabelPolicy(req, null).then((resp) => resp.toObject()); } - public removeLabelPolicyFont(): - Promise { + public removeLabelPolicyFont(): Promise { const req = new RemoveCustomLabelPolicyFontRequest(); - return this.grpcService.mgmt.removeCustomLabelPolicyFont(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeCustomLabelPolicyFont(req, null).then((resp) => resp.toObject()); } - public removeLabelPolicyIcon(): - Promise { + public removeLabelPolicyIcon(): Promise { const req = new RemoveCustomLabelPolicyIconRequest(); - return this.grpcService.mgmt.removeCustomLabelPolicyIcon(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeCustomLabelPolicyIcon(req, null).then((resp) => resp.toObject()); } - public removeLabelPolicyIconDark(): - Promise { + public removeLabelPolicyIconDark(): Promise { const req = new RemoveCustomLabelPolicyIconDarkRequest(); - return this.grpcService.mgmt.removeCustomLabelPolicyIconDark(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeCustomLabelPolicyIconDark(req, null).then((resp) => resp.toObject()); } - public removeLabelPolicyLogo(): - Promise { + public removeLabelPolicyLogo(): Promise { const req = new RemoveCustomLabelPolicyLogoRequest(); - return this.grpcService.mgmt.removeCustomLabelPolicyLogo(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeCustomLabelPolicyLogo(req, null).then((resp) => resp.toObject()); } - public removeLabelPolicyLogoDark(): - Promise { + public removeLabelPolicyLogoDark(): Promise { const req = new RemoveCustomLabelPolicyLogoDarkRequest(); - return this.grpcService.mgmt.removeCustomLabelPolicyLogoDark(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeCustomLabelPolicyLogoDark(req, null).then((resp) => resp.toObject()); } public getOrgIAMPolicy(): Promise { const req = new GetOrgIAMPolicyRequest(); - return this.grpcService.mgmt.getOrgIAMPolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getOrgIAMPolicy(req, null).then((resp) => resp.toObject()); } public getPasswordAgePolicy(): Promise { const req = new GetPasswordAgePolicyRequest(); - return this.grpcService.mgmt.getPasswordAgePolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getPasswordAgePolicy(req, null).then((resp) => resp.toObject()); } public addCustomPasswordAgePolicy( @@ -1118,12 +1099,12 @@ export class ManagementService { req.setMaxAgeDays(maxAgeDays); req.setExpireWarnDays(expireWarnDays); - return this.grpcService.mgmt.addCustomPasswordAgePolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.addCustomPasswordAgePolicy(req, null).then((resp) => resp.toObject()); } public resetPasswordAgePolicyToDefault(): Promise { const req = new ResetPasswordAgePolicyToDefaultRequest(); - return this.grpcService.mgmt.resetPasswordAgePolicyToDefault(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.resetPasswordAgePolicyToDefault(req, null).then((resp) => resp.toObject()); } public updateCustomPasswordAgePolicy( @@ -1133,12 +1114,12 @@ export class ManagementService { const req = new UpdateCustomPasswordAgePolicyRequest(); req.setMaxAgeDays(maxAgeDays); req.setExpireWarnDays(expireWarnDays); - return this.grpcService.mgmt.updateCustomPasswordAgePolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.updateCustomPasswordAgePolicy(req, null).then((resp) => resp.toObject()); } public getPasswordComplexityPolicy(): Promise { const req = new GetPasswordComplexityPolicyRequest(); - return this.grpcService.mgmt.getPasswordComplexityPolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getPasswordComplexityPolicy(req, null).then((resp) => resp.toObject()); } public addCustomPasswordComplexityPolicy( @@ -1154,12 +1135,12 @@ export class ManagementService { req.setHasNumber(hasNumber); req.setHasSymbol(hasSymbol); req.setMinLength(minLength); - return this.grpcService.mgmt.addCustomPasswordComplexityPolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.addCustomPasswordComplexityPolicy(req, null).then((resp) => resp.toObject()); } public resetPasswordComplexityPolicyToDefault(): Promise { const req = new ResetPasswordComplexityPolicyToDefaultRequest(); - return this.grpcService.mgmt.resetPasswordComplexityPolicyToDefault(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.resetPasswordComplexityPolicyToDefault(req, null).then((resp) => resp.toObject()); } public updateCustomPasswordComplexityPolicy( @@ -1175,35 +1156,31 @@ export class ManagementService { req.setHasNumber(hasNumber); req.setHasSymbol(hasSymbol); req.setMinLength(minLength); - return this.grpcService.mgmt.updateCustomPasswordComplexityPolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.updateCustomPasswordComplexityPolicy(req, null).then((resp) => resp.toObject()); } public getLockoutPolicy(): Promise { const req = new GetLockoutPolicyRequest(); - return this.grpcService.mgmt.getLockoutPolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getLockoutPolicy(req, null).then((resp) => resp.toObject()); } - public addCustomLockoutPolicy( - maxAttempts: number, - ): Promise { + public addCustomLockoutPolicy(maxAttempts: number): Promise { const req = new AddCustomLockoutPolicyRequest(); req.setMaxPasswordAttempts(maxAttempts); - return this.grpcService.mgmt.addCustomLockoutPolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.addCustomLockoutPolicy(req, null).then((resp) => resp.toObject()); } public resetLockoutPolicyToDefault(): Promise { const req = new ResetLockoutPolicyToDefaultRequest(); - return this.grpcService.mgmt.resetLockoutPolicyToDefault(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.resetLockoutPolicyToDefault(req, null).then((resp) => resp.toObject()); } - public updateCustomLockoutPolicy( - maxAttempts: number, - ): Promise { + public updateCustomLockoutPolicy(maxAttempts: number): Promise { const req = new UpdateCustomLockoutPolicyRequest(); req.setMaxPasswordAttempts(maxAttempts); - return this.grpcService.mgmt.updateCustomLockoutPolicy(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.updateCustomLockoutPolicy(req, null).then((resp) => resp.toObject()); } public getLocalizedComplexityPolicyPatternErrorString(policy: PasswordComplexityPolicy.AsObject): string { @@ -1221,11 +1198,15 @@ export class ManagementService { public getUserByID(id: string): Promise { const req = new GetUserByIDRequest(); req.setId(id); - return this.grpcService.mgmt.getUserByID(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getUserByID(req, null).then((resp) => resp.toObject()); } - public listUserMetadata(userId: string, offset?: number, limit?: number, queryList?: MetadataQuery[]): - Promise { + public listUserMetadata( + userId: string, + offset?: number, + limit?: number, + queryList?: MetadataQuery[], + ): Promise { const req = new ListUserMetadataRequest(); req.setId(userId); @@ -1239,14 +1220,14 @@ export class ManagementService { if (queryList) { req.setQueriesList(queryList); } - return this.grpcService.mgmt.listUserMetadata(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listUserMetadata(req, null).then((resp) => resp.toObject()); } public getUserMetadata(userId: string, key: string): Promise { const req = new GetUserMetadataRequest(); req.setId(userId); req.setKey(key); - return this.grpcService.mgmt.getUserMetadata(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getUserMetadata(req, null).then((resp) => resp.toObject()); } public setUserMetadata(key: string, value: string, userId: string): Promise { @@ -1254,28 +1235,30 @@ export class ManagementService { req.setKey(key); req.setValue(value); req.setId(userId); - return this.grpcService.mgmt.setUserMetadata(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.setUserMetadata(req, null).then((resp) => resp.toObject()); } - public bulkSetUserMetadata(list: BulkSetUserMetadataRequest.Metadata[], userId: string): - Promise { + public bulkSetUserMetadata( + list: BulkSetUserMetadataRequest.Metadata[], + userId: string, + ): Promise { const req = new BulkSetUserMetadataRequest(); req.setMetadataList(list); req.setId(userId); - return this.grpcService.mgmt.bulkSetUserMetadata(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.bulkSetUserMetadata(req, null).then((resp) => resp.toObject()); } public removeUserMetadata(key: string, userId: string): Promise { const req = new RemoveUserMetadataRequest(); req.setKey(key); req.setId(userId); - return this.grpcService.mgmt.removeUserMetadata(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeUserMetadata(req, null).then((resp) => resp.toObject()); } public removeUser(id: string): Promise { const req = new RemoveUserRequest(); req.setId(id); - return this.grpcService.mgmt.removeUser(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeUser(req, null).then((resp) => resp.toObject()); } public listProjectMembers( @@ -1298,11 +1281,13 @@ export class ManagementService { req.setQueriesList(queryList); } req.setQuery(query); - return this.grpcService.mgmt.listProjectMembers(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listProjectMembers(req, null).then((resp) => resp.toObject()); } - public listUserMemberships(userId: string, - limit: number, offset: number, + public listUserMemberships( + userId: string, + limit: number, + offset: number, queryList?: MembershipQuery[], ): Promise { const req = new ListUserMembershipsRequest(); @@ -1318,32 +1303,32 @@ export class ManagementService { req.setQueriesList(queryList); } req.setQuery(metadata); - return this.grpcService.mgmt.listUserMemberships(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listUserMemberships(req, null).then((resp) => resp.toObject()); } public getHumanProfile(userId: string): Promise { const req = new GetHumanProfileRequest(); req.setUserId(userId); - return this.grpcService.mgmt.getHumanProfile(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getHumanProfile(req, null).then((resp) => resp.toObject()); } public listHumanMultiFactors(userId: string): Promise { const req = new ListHumanAuthFactorsRequest(); req.setUserId(userId); - return this.grpcService.mgmt.listHumanAuthFactors(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listHumanAuthFactors(req, null).then((resp) => resp.toObject()); } public removeHumanMultiFactorOTP(userId: string): Promise { const req = new RemoveHumanAuthFactorOTPRequest(); req.setUserId(userId); - return this.grpcService.mgmt.removeHumanAuthFactorOTP(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeHumanAuthFactorOTP(req, null).then((resp) => resp.toObject()); } public removeHumanAuthFactorU2F(userId: string, tokenId: string): Promise { const req = new RemoveHumanAuthFactorU2FRequest(); req.setUserId(userId); req.setTokenId(tokenId); - return this.grpcService.mgmt.removeHumanAuthFactorU2F(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeHumanAuthFactorU2F(req, null).then((resp) => resp.toObject()); } public updateHumanProfile( @@ -1375,45 +1360,45 @@ export class ManagementService { if (preferredLanguage) { req.setPreferredLanguage(preferredLanguage); } - return this.grpcService.mgmt.updateHumanProfile(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.updateHumanProfile(req, null).then((resp) => resp.toObject()); } public getHumanEmail(id: string): Promise { const req = new GetHumanEmailRequest(); req.setUserId(id); - return this.grpcService.mgmt.getHumanEmail(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getHumanEmail(req, null).then((resp) => resp.toObject()); } public updateHumanEmail(userId: string, email: string): Promise { const req = new UpdateHumanEmailRequest(); req.setUserId(userId); req.setEmail(email); - return this.grpcService.mgmt.updateHumanEmail(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.updateHumanEmail(req, null).then((resp) => resp.toObject()); } public getHumanPhone(userId: string): Promise { const req = new GetHumanPhoneRequest(); req.setUserId(userId); - return this.grpcService.mgmt.getHumanPhone(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getHumanPhone(req, null).then((resp) => resp.toObject()); } public updateHumanPhone(userId: string, phone: string): Promise { const req = new UpdateHumanPhoneRequest(); req.setUserId(userId); req.setPhone(phone); - return this.grpcService.mgmt.updateHumanPhone(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.updateHumanPhone(req, null).then((resp) => resp.toObject()); } public removeHumanPhone(userId: string): Promise { const req = new RemoveHumanPhoneRequest(); req.setUserId(userId); - return this.grpcService.mgmt.removeHumanPhone(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeHumanPhone(req, null).then((resp) => resp.toObject()); } public deactivateUser(id: string): Promise { const req = new DeactivateUserRequest(); req.setId(id); - return this.grpcService.mgmt.deactivateUser(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.deactivateUser(req, null).then((resp) => resp.toObject()); } public addUserGrant( @@ -1432,17 +1417,21 @@ export class ManagementService { req.setUserId(userId); req.setRoleKeysList(roleNamesList); - return this.grpcService.mgmt.addUserGrant(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.addUserGrant(req, null).then((resp) => resp.toObject()); } public reactivateUser(id: string): Promise { const req = new ReactivateUserRequest(); req.setId(id); - return this.grpcService.mgmt.reactivateUser(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.reactivateUser(req, null).then((resp) => resp.toObject()); } - public addProjectRole(projectId: string, roleKey: string, displayName: string, group: string): - Promise { + public addProjectRole( + projectId: string, + roleKey: string, + displayName: string, + group: string, + ): Promise { const req = new AddProjectRoleRequest(); req.setProjectId(projectId); req.setRoleKey(roleKey); @@ -1450,49 +1439,51 @@ export class ManagementService { req.setDisplayName(displayName); } req.setGroup(group); - return this.grpcService.mgmt.addProjectRole(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.addProjectRole(req, null).then((resp) => resp.toObject()); } public resendHumanEmailVerification(userId: string): Promise { const req = new ResendHumanEmailVerificationRequest(); req.setUserId(userId); - return this.grpcService.mgmt.resendHumanEmailVerification(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.resendHumanEmailVerification(req, null).then((resp) => resp.toObject()); } - public resendHumanInitialization(userId: string, newemail: string): - Promise { + public resendHumanInitialization(userId: string, newemail: string): Promise { const req = new ResendHumanInitializationRequest(); if (newemail) { req.setEmail(newemail); } req.setUserId(userId); - return this.grpcService.mgmt.resendHumanInitialization(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.resendHumanInitialization(req, null).then((resp) => resp.toObject()); } public resendHumanPhoneVerification(userId: string): Promise { const req = new ResendHumanPhoneVerificationRequest(); req.setUserId(userId); - return this.grpcService.mgmt.resendHumanPhoneVerification(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.resendHumanPhoneVerification(req, null).then((resp) => resp.toObject()); } public setHumanInitialPassword(id: string, password: string): Promise { const req = new SetHumanInitialPasswordRequest(); req.setUserId(id); req.setPassword(password); - return this.grpcService.mgmt.setHumanInitialPassword(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.setHumanInitialPassword(req, null).then((resp) => resp.toObject()); } - public sendHumanResetPasswordNotification(id: string, type: SendHumanResetPasswordNotificationRequest.Type): - Promise { + public sendHumanResetPasswordNotification(id: string, type: SendHumanResetPasswordNotificationRequest.Type): Promise { const req = new SendHumanResetPasswordNotificationRequest(); req.setUserId(id); req.setType(type); - return this.grpcService.mgmt.sendHumanResetPasswordNotification(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.sendHumanResetPasswordNotification(req, null).then((resp) => resp.toObject()); } - public listUsers(limit: number, offset: number, queriesList?: UserSearchQuery[], sortingColumn?: UserFieldName): - Promise { + public listUsers( + limit: number, + offset: number, + queriesList?: UserSearchQuery[], + sortingColumn?: UserFieldName, + ): Promise { const req = new ListUsersRequest(); const query = new ListQuery(); if (limit) { @@ -1508,13 +1499,13 @@ export class ManagementService { if (queriesList) { req.setQueriesList(queriesList); } - return this.grpcService.mgmt.listUsers(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listUsers(req, null).then((resp) => resp.toObject()); } public getUserByLoginNameGlobal(loginname: string): Promise { const req = new GetUserByLoginNameGlobalRequest(); req.setLoginName(loginname); - return this.grpcService.mgmt.getUserByLoginNameGlobal(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getUserByLoginNameGlobal(req, null).then((resp) => resp.toObject()); } // USER GRANTS @@ -1537,19 +1528,15 @@ export class ManagementService { if (queryList) { req.setQueriesList(queryList); } - return this.grpcService.mgmt.listUserGrants(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listUserGrants(req, null).then((resp) => resp.toObject()); } - - public getUserGrantByID( - grantId: string, - userId: string, - ): Promise { + public getUserGrantByID(grantId: string, userId: string): Promise { const req = new GetUserGrantByIDRequest(); req.setGrantId(grantId); req.setUserId(userId); - return this.grpcService.mgmt.getUserGrantByID(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getUserGrantByID(req, null).then((resp) => resp.toObject()); } public updateUserGrant( @@ -1562,31 +1549,30 @@ export class ManagementService { req.setRoleKeysList(roleKeysList); req.setUserId(userId); - return this.grpcService.mgmt.updateUserGrant(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.updateUserGrant(req, null).then((resp) => resp.toObject()); } - public removeUserGrant( - grantId: string, - userId: string, - ): Promise { + public removeUserGrant(grantId: string, userId: string): Promise { const req = new RemoveUserGrantRequest(); req.setGrantId(grantId); req.setUserId(userId); - return this.grpcService.mgmt.removeUserGrant(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeUserGrant(req, null).then((resp) => resp.toObject()); } - public bulkRemoveUserGrant( - grantIdsList: string[], - ): Promise { + public bulkRemoveUserGrant(grantIdsList: string[]): Promise { const req = new BulkRemoveUserGrantRequest(); req.setGrantIdList(grantIdsList); - return this.grpcService.mgmt.bulkRemoveUserGrant(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.bulkRemoveUserGrant(req, null).then((resp) => resp.toObject()); } - public listAppChanges(appId: string, projectId: string, limit: number, sequence: number): - Promise { + public listAppChanges( + appId: string, + projectId: string, + limit: number, + sequence: number, + ): Promise { const req = new ListAppChangesRequest(); const query = new ChangeQuery(); req.setAppId(appId); @@ -1599,7 +1585,7 @@ export class ManagementService { query.setSequence(sequence); } req.setQuery(query); - return this.grpcService.mgmt.listAppChanges(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listAppChanges(req, null).then((resp) => resp.toObject()); } public listOrgChanges(limit: number, sequence: number): Promise { @@ -1614,11 +1600,14 @@ export class ManagementService { } req.setQuery(query); - return this.grpcService.mgmt.listOrgChanges(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listOrgChanges(req, null).then((resp) => resp.toObject()); } - public listProjectChanges(projectId: string, limit: number, sequence: number): - Promise { + public listProjectChanges( + projectId: string, + limit: number, + sequence: number, + ): Promise { const req = new ListProjectChangesRequest(); req.setProjectId(projectId); const query = new ChangeQuery(); @@ -1631,11 +1620,10 @@ export class ManagementService { } req.setQuery(query); - return this.grpcService.mgmt.listProjectChanges(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listProjectChanges(req, null).then((resp) => resp.toObject()); } - public listUserChanges(userId: string, limit: number, sequence: number): - Promise { + public listUserChanges(userId: string, limit: number, sequence: number): Promise { const req = new ListUserChangesRequest(); req.setUserId(userId); const query = new ChangeQuery(); @@ -1648,13 +1636,12 @@ export class ManagementService { } req.setQuery(query); - return this.grpcService.mgmt.listUserChanges(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listUserChanges(req, null).then((resp) => resp.toObject()); } // project - public listProjects( - limit?: number, offset?: number, queryList?: ProjectQuery[]): Promise { + public listProjects(limit?: number, offset?: number, queryList?: ProjectQuery[]): Promise { const req = new ListProjectsRequest(); const query = new ListQuery(); @@ -1670,7 +1657,7 @@ export class ManagementService { if (queryList) { req.setQueriesList(queryList); } - return this.grpcService.mgmt.listProjects(req, null).then(value => { + return this.grpcService.mgmt.listProjects(req, null).then((value) => { const obj = value.toObject(); const count = obj.resultList.length; if (count >= 0) { @@ -1682,7 +1669,10 @@ export class ManagementService { } public listGrantedProjects( - limit: number, offset: number, queryList?: ProjectQuery[]): Promise { + limit: number, + offset: number, + queryList?: ProjectQuery[], + ): Promise { const req = new ListGrantedProjectsRequest(); const query = new ListQuery(); @@ -1697,7 +1687,7 @@ export class ManagementService { if (queryList) { req.setQueriesList(queryList); } - return this.grpcService.mgmt.listGrantedProjects(req, null).then(value => { + return this.grpcService.mgmt.listGrantedProjects(req, null).then((value) => { const obj = value.toObject(); this.grantedProjectsCount.next(obj.resultList.length); return obj; @@ -1706,26 +1696,26 @@ export class ManagementService { public getOIDCInformation(): Promise { const req = new GetOIDCInformationRequest(); - return this.grpcService.mgmt.getOIDCInformation(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getOIDCInformation(req, null).then((resp) => resp.toObject()); } public getProjectByID(projectId: string): Promise { const req = new GetProjectByIDRequest(); req.setId(projectId); - return this.grpcService.mgmt.getProjectByID(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getProjectByID(req, null).then((resp) => resp.toObject()); } public getGrantedProjectByID(projectId: string, grantId: string): Promise { const req = new GetGrantedProjectByIDRequest(); req.setGrantId(grantId); req.setProjectId(projectId); - return this.grpcService.mgmt.getGrantedProjectByID(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getGrantedProjectByID(req, null).then((resp) => resp.toObject()); } public addProject(project: AddProjectRequest.AsObject): Promise { const req = new AddProjectRequest(); req.setName(project.name); - return this.grpcService.mgmt.addProject(req, null).then(value => { + return this.grpcService.mgmt.addProject(req, null).then((value) => { const current = this.ownedProjectsCount.getValue(); this.ownedProjectsCount.next(current + 1); return value.toObject(); @@ -1733,39 +1723,41 @@ export class ManagementService { } public updateProject(req: UpdateProjectRequest): Promise { - return this.grpcService.mgmt.updateProject(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.updateProject(req, null).then((resp) => resp.toObject()); } - public updateProjectGrant(grantId: string, projectId: string, rolesList: string[]): - Promise { + public updateProjectGrant( + grantId: string, + projectId: string, + rolesList: string[], + ): Promise { const req = new UpdateProjectGrantRequest(); req.setRoleKeysList(rolesList); req.setGrantId(grantId); req.setProjectId(projectId); - return this.grpcService.mgmt.updateProjectGrant(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.updateProjectGrant(req, null).then((resp) => resp.toObject()); } public removeProjectGrant(grantId: string, projectId: string): Promise { const req = new RemoveProjectGrantRequest(); req.setGrantId(grantId); req.setProjectId(projectId); - return this.grpcService.mgmt.removeProjectGrant(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeProjectGrant(req, null).then((resp) => resp.toObject()); } public deactivateProject(projectId: string): Promise { const req = new DeactivateProjectRequest(); req.setId(projectId); - return this.grpcService.mgmt.deactivateProject(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.deactivateProject(req, null).then((resp) => resp.toObject()); } public reactivateProject(projectId: string): Promise { const req = new ReactivateProjectRequest(); req.setId(projectId); - return this.grpcService.mgmt.reactivateProject(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.reactivateProject(req, null).then((resp) => resp.toObject()); } - public listProjectGrants(projectId: string, limit: number, offset: number): - Promise { + public listProjectGrants(projectId: string, limit: number, offset: number): Promise { const req = new ListProjectGrantsRequest(); req.setProjectId(projectId); const query = new ListQuery(); @@ -1778,30 +1770,36 @@ export class ManagementService { } req.setQuery(query); - return this.grpcService.mgmt.listProjectGrants(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listProjectGrants(req, null).then((resp) => resp.toObject()); } public listProjectGrantMemberRoles(): Promise { const req = new ListProjectGrantMemberRolesRequest(); - return this.grpcService.mgmt.listProjectGrantMemberRoles(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listProjectGrantMemberRoles(req, null).then((resp) => resp.toObject()); } - public addProjectMember(projectId: string, userId: string, rolesList: string[]): - Promise { + public addProjectMember( + projectId: string, + userId: string, + rolesList: string[], + ): Promise { const req = new AddProjectMemberRequest(); req.setProjectId(projectId); req.setUserId(userId); req.setRolesList(rolesList); - return this.grpcService.mgmt.addProjectMember(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.addProjectMember(req, null).then((resp) => resp.toObject()); } - public updateProjectMember(projectId: string, userId: string, rolesList: string[]): - Promise { + public updateProjectMember( + projectId: string, + userId: string, + rolesList: string[], + ): Promise { const req = new UpdateProjectMemberRequest(); req.setProjectId(projectId); req.setUserId(userId); req.setRolesList(rolesList); - return this.grpcService.mgmt.updateProjectMember(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.updateProjectMember(req, null).then((resp) => resp.toObject()); } public addProjectGrantMember( @@ -1815,7 +1813,7 @@ export class ManagementService { req.setGrantId(grantId); req.setUserId(userId); req.setRolesList(rolesList); - return this.grpcService.mgmt.addProjectGrantMember(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.addProjectGrantMember(req, null).then((resp) => resp.toObject()); } public updateProjectGrantMember( @@ -1829,7 +1827,7 @@ export class ManagementService { req.setGrantId(grantId); req.setUserId(userId); req.setRolesList(rolesList); - return this.grpcService.mgmt.updateProjectGrantMember(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.updateProjectGrantMember(req, null).then((resp) => resp.toObject()); } public listProjectGrantMembers( @@ -1856,7 +1854,7 @@ export class ManagementService { req.setQueriesList(queryList); } - return this.grpcService.mgmt.listProjectGrantMembers(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listProjectGrantMembers(req, null).then((resp) => resp.toObject()); } public removeProjectGrantMember( @@ -1868,7 +1866,7 @@ export class ManagementService { req.setGrantId(grantId); req.setUserId(userId); req.setProjectId(projectId); - return this.grpcService.mgmt.removeProjectGrantMember(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeProjectGrantMember(req, null).then((resp) => resp.toObject()); } public reactivateApp(projectId: string, appId: string): Promise { @@ -1876,7 +1874,7 @@ export class ManagementService { req.setAppId(appId); req.setProjectId(projectId); - return this.grpcService.mgmt.reactivateApp(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.reactivateApp(req, null).then((resp) => resp.toObject()); } public deactivateApp(projectId: string, appId: string): Promise { @@ -1884,15 +1882,14 @@ export class ManagementService { req.setAppId(appId); req.setProjectId(projectId); - return this.grpcService.mgmt.deactivateApp(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.deactivateApp(req, null).then((resp) => resp.toObject()); } - public regenerateOIDCClientSecret(appId: string, projectId: string): - Promise { + public regenerateOIDCClientSecret(appId: string, projectId: string): Promise { const req = new RegenerateOIDCClientSecretRequest(); req.setAppId(appId); req.setProjectId(projectId); - return this.grpcService.mgmt.regenerateOIDCClientSecret(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.regenerateOIDCClientSecret(req, null).then((resp) => resp.toObject()); } public listAppKeys( @@ -1912,7 +1909,7 @@ export class ManagementService { metaData.setOffset(offset); } req.setQuery(metaData); - return this.grpcService.mgmt.listAppKeys(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listAppKeys(req, null).then((resp) => resp.toObject()); } public addAppKey( @@ -1928,19 +1925,15 @@ export class ManagementService { if (expirationDate) { req.setExpirationDate(expirationDate); } - return this.grpcService.mgmt.addAppKey(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.addAppKey(req, null).then((resp) => resp.toObject()); } - public removeAppKey( - projectId: string, - appId: string, - keyId: string, - ): Promise { + public removeAppKey(projectId: string, appId: string, keyId: string): Promise { const req = new RemoveAppKeyRequest(); req.setAppId(appId); req.setKeyId(keyId); req.setProjectId(projectId); - return this.grpcService.mgmt.removeAppKey(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeAppKey(req, null).then((resp) => resp.toObject()); } public listProjectRoles( @@ -1964,7 +1957,7 @@ export class ManagementService { if (queryList) { req.setQueriesList(queryList); } - return this.grpcService.mgmt.listProjectRoles(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listProjectRoles(req, null).then((resp) => resp.toObject()); } public bulkAddProjectRoles( @@ -1974,40 +1967,43 @@ export class ManagementService { const req = new BulkAddProjectRolesRequest(); req.setProjectId(projectId); req.setRolesList(rolesList); - return this.grpcService.mgmt.bulkAddProjectRoles(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.bulkAddProjectRoles(req, null).then((resp) => resp.toObject()); } public removeProjectRole(projectId: string, roleKey: string): Promise { const req = new RemoveProjectRoleRequest(); req.setProjectId(projectId); req.setRoleKey(roleKey); - return this.grpcService.mgmt.removeProjectRole(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeProjectRole(req, null).then((resp) => resp.toObject()); } - - public updateProjectRole(projectId: string, roleKey: string, displayName: string, group: string): - Promise { + public updateProjectRole( + projectId: string, + roleKey: string, + displayName: string, + group: string, + ): Promise { const req = new UpdateProjectRoleRequest(); req.setProjectId(projectId); req.setRoleKey(roleKey); req.setGroup(group); req.setDisplayName(displayName); - return this.grpcService.mgmt.updateProjectRole(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.updateProjectRole(req, null).then((resp) => resp.toObject()); } - public removeProjectMember(projectId: string, userId: string): Promise { const req = new RemoveProjectMemberRequest(); req.setProjectId(projectId); req.setUserId(userId); - return this.grpcService.mgmt.removeProjectMember(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeProjectMember(req, null).then((resp) => resp.toObject()); } public listApps( projectId: string, limit: number, offset: number, - queryList?: AppQuery[]): Promise { + queryList?: AppQuery[], + ): Promise { const req = new ListAppsRequest(); req.setProjectId(projectId); const query = new ListQuery(); @@ -2021,32 +2017,32 @@ export class ManagementService { if (queryList) { req.setQueriesList(queryList); } - return this.grpcService.mgmt.listApps(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listApps(req, null).then((resp) => resp.toObject()); } public getAppByID(projectId: string, appId: string): Promise { const req = new GetAppByIDRequest(); req.setProjectId(projectId); req.setAppId(appId); - return this.grpcService.mgmt.getAppByID(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getAppByID(req, null).then((resp) => resp.toObject()); } public listProjectMemberRoles(): Promise { const req = new ListProjectMemberRolesRequest(); - return this.grpcService.mgmt.listProjectMemberRoles(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.listProjectMemberRoles(req, null).then((resp) => resp.toObject()); } public getProjectGrantByID(grantId: string, projectId: string): Promise { const req = new GetProjectGrantByIDRequest(); req.setGrantId(grantId); req.setProjectId(projectId); - return this.grpcService.mgmt.getProjectGrantByID(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.getProjectGrantByID(req, null).then((resp) => resp.toObject()); } public removeProject(id: string): Promise { const req = new RemoveProjectRequest(); req.setId(id); - return this.grpcService.mgmt.removeProject(req, null).then(value => { + return this.grpcService.mgmt.removeProject(req, null).then((value) => { const current = this.ownedProjectsCount.getValue(); this.ownedProjectsCount.next(current > 0 ? current - 1 : 0); return value.toObject(); @@ -2057,14 +2053,14 @@ export class ManagementService { const req = new DeactivateProjectGrantRequest(); req.setGrantId(grantId); req.setProjectId(projectId); - return this.grpcService.mgmt.deactivateProjectGrant(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.deactivateProjectGrant(req, null).then((resp) => resp.toObject()); } public reactivateProjectGrant(grantId: string, projectId: string): Promise { const req = new ReactivateProjectGrantRequest(); req.setGrantId(grantId); req.setProjectId(projectId); - return this.grpcService.mgmt.reactivateProjectGrant(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.reactivateProjectGrant(req, null).then((resp) => resp.toObject()); } public addOIDCApp(app: AddOIDCAppRequest.AsObject): Promise { @@ -2077,7 +2073,7 @@ export class ManagementService { req.setAppType(app.appType); req.setPostLogoutRedirectUrisList(app.postLogoutRedirectUrisList); req.setRedirectUrisList(app.redirectUrisList); - return this.grpcService.mgmt.addOIDCApp(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.addOIDCApp(req, null).then((resp) => resp.toObject()); } public addAPIApp(app: AddAPIAppRequest.AsObject): Promise { @@ -2085,14 +2081,14 @@ export class ManagementService { req.setAuthMethodType(app.authMethodType); req.setName(app.name); req.setProjectId(app.projectId); - return this.grpcService.mgmt.addAPIApp(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.addAPIApp(req, null).then((resp) => resp.toObject()); } public regenerateAPIClientSecret(appId: string, projectId: string): Promise { const req = new RegenerateAPIClientSecretRequest(); req.setAppId(appId); req.setProjectId(projectId); - return this.grpcService.mgmt.regenerateAPIClientSecret(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.regenerateAPIClientSecret(req, null).then((resp) => resp.toObject()); } public updateApp(projectId: string, appId: string, name: string): Promise { @@ -2100,21 +2096,21 @@ export class ManagementService { req.setAppId(appId); req.setName(name); req.setProjectId(projectId); - return this.grpcService.mgmt.updateApp(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.updateApp(req, null).then((resp) => resp.toObject()); } public updateOIDCAppConfig(req: UpdateOIDCAppConfigRequest): Promise { - return this.grpcService.mgmt.updateOIDCAppConfig(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.updateOIDCAppConfig(req, null).then((resp) => resp.toObject()); } public updateAPIAppConfig(req: UpdateAPIAppConfigRequest): Promise { - return this.grpcService.mgmt.updateAPIAppConfig(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.updateAPIAppConfig(req, null).then((resp) => resp.toObject()); } public removeApp(projectId: string, appId: string): Promise { const req = new RemoveAppRequest(); req.setAppId(appId); req.setProjectId(projectId); - return this.grpcService.mgmt.removeApp(req, null).then(resp => resp.toObject()); + return this.grpcService.mgmt.removeApp(req, null).then((resp) => resp.toObject()); } } diff --git a/console/src/assets/i18n/de.json b/console/src/assets/i18n/de.json index c8143281fc..e2f0da9c34 100644 --- a/console/src/assets/i18n/de.json +++ b/console/src/assets/i18n/de.json @@ -339,6 +339,9 @@ "EMAIL": "E-Mail", "PHONE": "Telefonnummer", "USERNAME": "Benutzername", + "CHANGEUSERNAME":"bearbeiten", + "CHANGEUSERNAME_TITLE":"Benutzername ändern", + "CHANGEUSERNAME_DESC":"Geben Sie ihren neuen Namen an.", "FIRSTNAME": "Vorname", "LASTNAME": "Nachname", "NICKNAME": "Spitzname", @@ -473,6 +476,7 @@ "TOAST": { "CREATED": "Benutzer erfolgreich erstellt.", "SAVED": "Profil gespeichert.", + "USERNAMECHANGED":"Username geändert.", "EMAILSAVED": "E-Mail gespeichert.", "INITEMAILSENT": "Initialisierung Email gesendet.", "PHONESAVED": "Telefonnummer gespeichert.", diff --git a/console/src/assets/i18n/en.json b/console/src/assets/i18n/en.json index 6d294d0b4e..8441568d5c 100644 --- a/console/src/assets/i18n/en.json +++ b/console/src/assets/i18n/en.json @@ -339,6 +339,9 @@ "EMAIL": "E-mail", "PHONE": "Phonenumber", "USERNAME": "User Name", + "CHANGEUSERNAME":"modify", + "CHANGEUSERNAME_TITLE":"Change username", + "CHANGEUSERNAME_DESC":"Enter the new name in the field below.", "FIRSTNAME": "First Name", "LASTNAME": "Last Name", "NICKNAME": "Nickname", @@ -473,6 +476,7 @@ "TOAST": { "CREATED": "User created successfully.", "SAVED": "Profile saved successfully.", + "USERNAMECHANGED":"Username changed.", "EMAILSAVED": "E-mail saved successfully.", "INITEMAILSENT": "Initializing mail sent.", "PHONESAVED": "Phone saved successfully.",