Skip to content

backends-web-backend


Class: UsersService

Defined in: backends/web-backend/src/users/users.service.ts:163

Constructors

Constructor

new UsersService(userModel, projectModel, teamModel, notificationModel, jwtService, storage, twoFactorService, sessionsService, eventBus, orgsService): UsersService

Defined in: backends/web-backend/src/users/users.service.ts:164

Parameters

userModel

Model<Document<unknown, { }, User, { }, { }> & User & object & object>

projectModel

Model<Document<unknown, { }, Project, { }, { }> & Project & object & object>

teamModel

Model<Document<unknown, { }, Team, { }, { }> & Team & object & object>

notificationModel

Model<Document<unknown, { }, Notification, { }, { }> & Notification & object & object>

jwtService

JwtService

storage

StorageService

twoFactorService

TwoFactorService

sessionsService

SessionsService

eventBus

EventBus

orgsService

OrgsService

Returns

UsersService

Methods

beginTwoFactorSetup()

beginTwoFactorSetup(username): Promise<{ otpauthUri: string; secret: string; }>

Defined in: backends/web-backend/src/users/users.service.ts:324

Parameters

username

string

Returns

Promise<{ otpauthUri: string; secret: string; }>


changeEmail()

changeEmail(username, payload, jti): Promise<{ profile: { altEmail: string; avatarUrl: string | null; bio: string; connectedAccounts: object[]; coverUrl: string | null; email: string; fullName: string; hasPassword: boolean; initials: string; linkedin: string; memberSince: string; organization: string; phone: string; signatureDataUrl: string | null; title: string; twoFactorEnabled: boolean; username: string; }; token: string; }>

Defined in: backends/web-backend/src/users/users.service.ts:279

Parameters

username

string

payload
currentPassword

string = ...

newEmail

string = ...

jti

string

Returns

Promise<{ profile: { altEmail: string; avatarUrl: string | null; bio: string; connectedAccounts: object[]; coverUrl: string | null; email: string; fullName: string; hasPassword: boolean; initials: string; linkedin: string; memberSince: string; organization: string; phone: string; signatureDataUrl: string | null; title: string; twoFactorEnabled: boolean; username: string; }; token: string; }>


changePassword()

changePassword(username, payload): Promise<void>

Defined in: backends/web-backend/src/users/users.service.ts:311

Parameters

username

string

payload
currentPassword

string = ...

newPassword

string = ...

Returns

Promise<void>


changeUsername()

changeUsername(username, payload, jti): Promise<{ profile: { altEmail: string; avatarUrl: string | null; bio: string; connectedAccounts: object[]; coverUrl: string | null; email: string; fullName: string; hasPassword: boolean; initials: string; linkedin: string; memberSince: string; organization: string; phone: string; signatureDataUrl: string | null; title: string; twoFactorEnabled: boolean; username: string; }; token: string; }>

Defined in: backends/web-backend/src/users/users.service.ts:295

Parameters

username

string

payload
newUsername

string = ...

jti

string

Returns

Promise<{ profile: { altEmail: string; avatarUrl: string | null; bio: string; connectedAccounts: object[]; coverUrl: string | null; email: string; fullName: string; hasPassword: boolean; initials: string; linkedin: string; memberSince: string; organization: string; phone: string; signatureDataUrl: string | null; title: string; twoFactorEnabled: boolean; username: string; }; token: string; }>


clearAvatar()

clearAvatar(username): Promise<{ altEmail: string; avatarUrl: string | null; bio: string; connectedAccounts: object[]; coverUrl: string | null; email: string; fullName: string; hasPassword: boolean; initials: string; linkedin: string; memberSince: string; organization: string; phone: string; signatureDataUrl: string | null; title: string; twoFactorEnabled: boolean; username: string; }>

Defined in: backends/web-backend/src/users/users.service.ts:478

Parameters

username

string

Returns

Promise<{ altEmail: string; avatarUrl: string | null; bio: string; connectedAccounts: object[]; coverUrl: string | null; email: string; fullName: string; hasPassword: boolean; initials: string; linkedin: string; memberSince: string; organization: string; phone: string; signatureDataUrl: string | null; title: string; twoFactorEnabled: boolean; username: string; }>


clearCover()

clearCover(username): Promise<{ altEmail: string; avatarUrl: string | null; bio: string; connectedAccounts: object[]; coverUrl: string | null; email: string; fullName: string; hasPassword: boolean; initials: string; linkedin: string; memberSince: string; organization: string; phone: string; signatureDataUrl: string | null; title: string; twoFactorEnabled: boolean; username: string; }>

Defined in: backends/web-backend/src/users/users.service.ts:507

Parameters

username

string

Returns

Promise<{ altEmail: string; avatarUrl: string | null; bio: string; connectedAccounts: object[]; coverUrl: string | null; email: string; fullName: string; hasPassword: boolean; initials: string; linkedin: string; memberSince: string; organization: string; phone: string; signatureDataUrl: string | null; title: string; twoFactorEnabled: boolean; username: string; }>


clearSignature()

clearSignature(username): Promise<{ signatureDataUrl: string | null; }>

Defined in: backends/web-backend/src/users/users.service.ts:531

Parameters

username

string

Returns

Promise<{ signatureDataUrl: string | null; }>


deleteMyAccount()

deleteMyAccount(username, currentPassword): Promise<void>

Defined in: backends/web-backend/src/users/users.service.ts:411

Parameters

username

string

currentPassword

string

Returns

Promise<void>


disableTwoFactor()

disableTwoFactor(username, code): Promise<{ detail: string; }>

Defined in: backends/web-backend/src/users/users.service.ts:356

Parameters

username

string

code

string

Returns

Promise<{ detail: string; }>


disconnectProvider()

disconnectProvider(username, provider): Promise<{ altEmail: string; avatarUrl: string | null; bio: string; connectedAccounts: object[]; coverUrl: string | null; email: string; fullName: string; hasPassword: boolean; initials: string; linkedin: string; memberSince: string; organization: string; phone: string; signatureDataUrl: string | null; title: string; twoFactorEnabled: boolean; username: string; }>

Defined in: backends/web-backend/src/users/users.service.ts:375

Parameters

username

string

provider

string

Returns

Promise<{ altEmail: string; avatarUrl: string | null; bio: string; connectedAccounts: object[]; coverUrl: string | null; email: string; fullName: string; hasPassword: boolean; initials: string; linkedin: string; memberSince: string; organization: string; phone: string; signatureDataUrl: string | null; title: string; twoFactorEnabled: boolean; username: string; }>


enableTwoFactor()

enableTwoFactor(username, code): Promise<{ backupCodes: string[]; }>

Defined in: backends/web-backend/src/users/users.service.ts:335

Parameters

username

string

code

string

Returns

Promise<{ backupCodes: string[]; }>


exportMyData()

exportMyData(username): Promise<DataExport>

Defined in: backends/web-backend/src/users/users.service.ts:226

Parameters

username

string

Returns

Promise<DataExport>


getMyProfile()

getMyProfile(username): Promise<{ altEmail: string; avatarUrl: string | null; bio: string; connectedAccounts: object[]; coverUrl: string | null; email: string; fullName: string; hasPassword: boolean; initials: string; linkedin: string; memberSince: string; organization: string; phone: string; signatureDataUrl: string | null; title: string; twoFactorEnabled: boolean; username: string; }>

Defined in: backends/web-backend/src/users/users.service.ts:177

Parameters

username

string

Returns

Promise<{ altEmail: string; avatarUrl: string | null; bio: string; connectedAccounts: object[]; coverUrl: string | null; email: string; fullName: string; hasPassword: boolean; initials: string; linkedin: string; memberSince: string; organization: string; phone: string; signatureDataUrl: string | null; title: string; twoFactorEnabled: boolean; username: string; }>


getMyProjectCount()

getMyProjectCount(username): Promise<number>

Defined in: backends/web-backend/src/users/users.service.ts:222

Parameters

username

string

Returns

Promise<number>


getNotificationPrefs()

getNotificationPrefs(username): Promise<{ projectShared: boolean; quantErrors: boolean; runFinished: boolean; teamInvite: boolean; }>

Defined in: backends/web-backend/src/users/users.service.ts:391

Parameters

username

string

Returns

Promise<{ projectShared: boolean; quantErrors: boolean; runFinished: boolean; teamInvite: boolean; }>


getPublicProfile()

getPublicProfile(username): Promise<{ avatarUrl: string | null; bio: string; coverUrl: string | null; fullName: string; initials: string; linkedin: string; memberSince: string; organization: string; title: string; username: string; }>

Defined in: backends/web-backend/src/users/users.service.ts:183

Parameters

username

string

Returns

Promise<{ avatarUrl: string | null; bio: string; coverUrl: string | null; fullName: string; initials: string; linkedin: string; memberSince: string; organization: string; title: string; username: string; }>


getSignature()

getSignature(username): Promise<{ signatureDataUrl: string | null; }>

Defined in: backends/web-backend/src/users/users.service.ts:517

Parameters

username

string

Returns

Promise<{ signatureDataUrl: string | null; }>


saveSignature()

saveSignature(username, signatureDataUrl): Promise<{ signatureDataUrl: string | null; }>

Defined in: backends/web-backend/src/users/users.service.ts:523

Parameters

username

string

signatureDataUrl

string

Returns

Promise<{ signatureDataUrl: string | null; }>


searchUsers()

searchUsers(query, actingUsername): Promise<{ users: object[]; }>

Defined in: backends/web-backend/src/users/users.service.ts:189

Parameters

query

string

actingUsername

string

Returns

Promise<{ users: object[]; }>


setAvatar()

setAvatar(username, file): Promise<{ altEmail: string; avatarUrl: string | null; bio: string; connectedAccounts: object[]; coverUrl: string | null; email: string; fullName: string; hasPassword: boolean; initials: string; linkedin: string; memberSince: string; organization: string; phone: string; signatureDataUrl: string | null; title: string; twoFactorEnabled: boolean; username: string; }>

Defined in: backends/web-backend/src/users/users.service.ts:459

Parameters

username

string

file
buffer

Buffer

mimetype

string

originalname

string

size

number

Returns

Promise<{ altEmail: string; avatarUrl: string | null; bio: string; connectedAccounts: object[]; coverUrl: string | null; email: string; fullName: string; hasPassword: boolean; initials: string; linkedin: string; memberSince: string; organization: string; phone: string; signatureDataUrl: string | null; title: string; twoFactorEnabled: boolean; username: string; }>


setCover()

setCover(username, file): Promise<{ altEmail: string; avatarUrl: string | null; bio: string; connectedAccounts: object[]; coverUrl: string | null; email: string; fullName: string; hasPassword: boolean; initials: string; linkedin: string; memberSince: string; organization: string; phone: string; signatureDataUrl: string | null; title: string; twoFactorEnabled: boolean; username: string; }>

Defined in: backends/web-backend/src/users/users.service.ts:488

Parameters

username

string

file
buffer

Buffer

mimetype

string

originalname

string

size

number

Returns

Promise<{ altEmail: string; avatarUrl: string | null; bio: string; connectedAccounts: object[]; coverUrl: string | null; email: string; fullName: string; hasPassword: boolean; initials: string; linkedin: string; memberSince: string; organization: string; phone: string; signatureDataUrl: string | null; title: string; twoFactorEnabled: boolean; username: string; }>


updateMyProfile()

updateMyProfile(username, payload): Promise<{ altEmail: string; avatarUrl: string | null; bio: string; connectedAccounts: object[]; coverUrl: string | null; email: string; fullName: string; hasPassword: boolean; initials: string; linkedin: string; memberSince: string; organization: string; phone: string; signatureDataUrl: string | null; title: string; twoFactorEnabled: boolean; username: string; }>

Defined in: backends/web-backend/src/users/users.service.ts:204

Parameters

username

string

payload
altEmail?

string = ...

bio?

string = ...

fullName?

string = ...

linkedin?

string = ...

organization?

string = ...

phone?

string = ...

title?

string = ...

Returns

Promise<{ altEmail: string; avatarUrl: string | null; bio: string; connectedAccounts: object[]; coverUrl: string | null; email: string; fullName: string; hasPassword: boolean; initials: string; linkedin: string; memberSince: string; organization: string; phone: string; signatureDataUrl: string | null; title: string; twoFactorEnabled: boolean; username: string; }>


updateNotificationPrefs()

updateNotificationPrefs(username, payload): Promise<{ projectShared: boolean; quantErrors: boolean; runFinished: boolean; teamInvite: boolean; }>

Defined in: backends/web-backend/src/users/users.service.ts:397

Parameters

username

string

payload
projectShared?

boolean = ...

quantErrors?

boolean = ...

runFinished?

boolean = ...

teamInvite?

boolean = ...

Returns

Promise<{ projectShared: boolean; quantErrors: boolean; runFinished: boolean; teamInvite: boolean; }>