Skip to main content

Class: UserUtils<U, A>

Defined in: auth/src/routes/UserUtils.ts:13

Utility class for working with persisted User objects in the database.

Type Parameters​

U​

U extends User

A​

A extends Alias

Constructors​

Constructor​

new UserUtils<U, A>(userClass, aliasClass): UserUtils<U, A>

Defined in: auth/src/routes/UserUtils.ts:22

Parameters​

userClass​

any

aliasClass​

any

Returns​

UserUtils<U, A>

Properties​

aliasClass​

protected aliasClass: any

Defined in: auth/src/routes/UserUtils.ts:14


aliasRepo?​

protected optional aliasRepo?: RepoUtils<A>

Defined in: auth/src/routes/UserUtils.ts:15


userClass​

protected userClass: any

Defined in: auth/src/routes/UserUtils.ts:16


userRepo?​

protected optional userRepo?: RepoUtils<U>

Defined in: auth/src/routes/UserUtils.ts:17

Methods​

init()​

protected init(): Promise<void>

Defined in: auth/src/routes/UserUtils.ts:28

Returns​

Promise<void>


lookup()​

lookup(id): Promise<U | undefined>

Defined in: auth/src/routes/UserUtils.ts:54

Performs a look up of the user with the given id. The id may be one of: the user's uid or an Alias.

Parameters​

id​

string

The unique id of the user to lookup.

Returns​

Promise<U | undefined>

The User if found, otherwise undefined.