Skip to main content

Class: UserUtils<U, A>

Defined in: src/routes/UserUtils.ts:12

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: src/routes/UserUtils.ts:21

Parameters

userClass

any

aliasClass

any

Returns

UserUtils<U, A>

Properties

aliasClass

protected aliasClass: any

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


aliasRepo?

protected optional aliasRepo?: RepoUtils<A>

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


objectFactory?

protected optional objectFactory?: ObjectFactory

Defined in: src/routes/UserUtils.ts:19


userClass

protected userClass: any

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


userRepo?

protected optional userRepo?: RepoUtils<U>

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

Methods

init()

protected init(): Promise<void>

Defined in: src/routes/UserUtils.ts:27

Returns

Promise<void>


lookup()

lookup(id): Promise<U | undefined>

Defined in: src/routes/UserUtils.ts:53

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.