Add createInviteLink to account rest client (#8456)

* Add createInviteLink to account rest client

Signed-off-by: Nikolay Chunosov <Chunosov.N@gmail.com>

* fix typo

Signed-off-by: Nikolay Chunosov <Chunosov.N@gmail.com>

* fix type

Signed-off-by: Nikolay Chunosov <Chunosov.N@gmail.com>

---------

Signed-off-by: Nikolay Chunosov <Chunosov.N@gmail.com>
This commit is contained in:
Chunosov 2025-04-03 22:13:49 +07:00 committed by GitHub
parent cac7902e50
commit 8038a47bf2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -61,6 +61,15 @@ export interface AccountClient {
requestPasswordReset: (email: string) => Promise<void>
sendInvite: (email: string, role: AccountRole) => Promise<void>
resendInvite: (email: string, role: AccountRole) => Promise<void>
createInviteLink: (
email: string,
role: AccountRole,
autoJoin: boolean,
firstName: string,
lastName: string,
navigateUrl?: string,
expHours?: number
) => Promise<string>
leaveWorkspace: (account: string) => Promise<LoginInfo | null>
changeUsername: (first: string, last: string) => Promise<void>
changePassword: (oldPassword: string, newPassword: string) => Promise<void>
@ -309,6 +318,23 @@ class AccountClientImpl implements AccountClient {
await this.rpc(request)
}
async createInviteLink (
email: string,
role: AccountRole,
autoJoin: boolean,
firstName: string,
lastName: string,
navigateUrl?: string,
expHours?: number
): Promise<string> {
const request = {
method: 'createInviteLink' as const,
params: { email, role, autoJoin, firstName, lastName, navigateUrl, expHours }
}
return await this.rpc(request)
}
async leaveWorkspace (account: string): Promise<LoginInfo | null> {
const request = {
method: 'leaveWorkspace' as const,