Skip to main content

Class: UserRepository

backend.UserRepository

Hierarchy#

Table of contents#

Constructors#

Properties#

Methods#

Constructors#

constructor#

• new UserRepository()

Overrides#

BaseRepository.constructor

Defined in#

system/core/backend/src/repositories/user.repository.ts:20

Properties#

dbType#

• dbType: "mysql" | "mariadb" | "postgres" | "cockroachdb" | "sqlite" | "mssql" | "sap" | "oracle" | "cordova" | "nativescript" | "react-native" | "sqljs" | "mongodb" | "aurora-data-api" | "aurora-data-api-pg" | "expo" | "better-sqlite3" | "capacitor"

Inherited from#

BaseRepository.dbType

Defined in#

system/core/backend/src/repositories/base.repository.ts:24

Methods#

applyBaseFilter#

â–¸ applyBaseFilter<EntityType>(qb, filter?): SelectQueryBuilder<EntityType>

Type parameters#

NameType
EntityTypeTBasePageEntity

Parameters#

NameType
qbSelectQueryBuilder<EntityType>
filter?BaseFilterInput

Returns#

SelectQueryBuilder<EntityType>

Inherited from#

BaseRepository.applyBaseFilter

Defined in#

system/core/backend/src/repositories/base.repository.ts:155


applyDeleteMany#

â–¸ applyDeleteMany(qb, input): Promise<void>

Parameters#

NameType
qbSelectQueryBuilder<User> | DeleteQueryBuilder<User>
inputTDeleteManyInput

Returns#

Promise<void>

Inherited from#

BaseRepository.applyDeleteMany

Defined in#

system/core/backend/src/repositories/base.repository.ts:108


applyGetEntityViews#

â–¸ applyGetEntityViews(qb, entityType): SelectQueryBuilder<TBasePageEntity>

Parameters#

NameType
qbSelectQueryBuilder<TBasePageEntity>
entityTypeEDBEntity

Returns#

SelectQueryBuilder<TBasePageEntity>

Inherited from#

BaseRepository.applyGetEntityViews

Defined in#

system/core/backend/src/repositories/base.repository.ts:133


applyUserFilter#

â–¸ applyUserFilter(qb, filterParams?): void

Parameters#

NameType
qbSelectQueryBuilder<TUser>
filterParams?UserFilterInput

Returns#

void

Defined in#

system/core/backend/src/repositories/user.repository.ts:137


createEntity#

â–¸ createEntity(input, id?): Promise<User>

Parameters#

NameType
inputUser
id?null | number

Returns#

Promise<User>

Inherited from#

BaseRepository.createEntity

Defined in#

system/core/backend/src/repositories/base.repository.ts:70


createUser#

â–¸ createUser(createUser, id?, passwordType?): Promise<User>

Parameters#

NameType
createUserTCreateUser
id?null | number
passwordType?"hash" | "plain"

Returns#

Promise<User>

Defined in#

system/core/backend/src/repositories/user.repository.ts:78


deleteEntity#

â–¸ deleteEntity(id): Promise<boolean>

Parameters#

NameType
idnumber

Returns#

Promise<boolean>

Inherited from#

BaseRepository.deleteEntity

Defined in#

system/core/backend/src/repositories/base.repository.ts:97


deleteMany#

â–¸ deleteMany(input): Promise<boolean>

Parameters#

NameType
inputTDeleteManyInput

Returns#

Promise<boolean>

Inherited from#

BaseRepository.deleteMany

Defined in#

system/core/backend/src/repositories/base.repository.ts:125


deleteManyFilteredUsers#

â–¸ deleteManyFilteredUsers(input, filterParams?): Promise<undefined | boolean>

Parameters#

NameType
inputTDeleteManyInput
filterParams?UserFilterInput

Returns#

Promise<undefined | boolean>

Defined in#

system/core/backend/src/repositories/user.repository.ts:182


deleteUser#

â–¸ deleteUser(id): Promise<boolean>

Parameters#

NameType
idnumber

Returns#

Promise<boolean>

Defined in#

system/core/backend/src/repositories/user.repository.ts:124


getAll#

â–¸ getAll(): Promise<User[]>

Returns#

Promise<User[]>

Inherited from#

BaseRepository.getAll

Defined in#

system/core/backend/src/repositories/base.repository.ts:44


getById#

â–¸ getById(id, relations?): Promise<User>

Parameters#

NameType
idnumber
relations?string[]

Returns#

Promise<User>

Inherited from#

BaseRepository.getById

Defined in#

system/core/backend/src/repositories/base.repository.ts:49


getBySlug#

â–¸ getBySlug(slug, relations?): Promise<User>

Parameters#

NameType
slugstring
relations?string[]

Returns#

Promise<User>

Inherited from#

BaseRepository.getBySlug

Defined in#

system/core/backend/src/repositories/base.repository.ts:60


getEntityViews#

â–¸ getEntityViews(entityId, entityType): Promise<any>

Parameters#

NameType
entityIdnumber
entityTypeEDBEntity

Returns#

Promise<any>

Inherited from#

BaseRepository.getEntityViews

Defined in#

system/core/backend/src/repositories/base.repository.ts:144


getFilteredEntities#

â–¸ getFilteredEntities(pagedParams?, filterParams?): Promise<TPagedList<User>>

Parameters#

NameType
pagedParams?PagedParamsInput<User>
filterParams?BaseFilterInput

Returns#

Promise<TPagedList<User>>

Inherited from#

BaseRepository.getFilteredEntities

Defined in#

system/core/backend/src/repositories/base.repository.ts:164


getFilteredUsers#

â–¸ getFilteredUsers(pagedParams?, filterParams?): Promise<TPagedList<TUser>>

Parameters#

NameType
pagedParams?PagedParamsInput<TUser>
filterParams?UserFilterInput

Returns#

Promise<TPagedList<TUser>>

Defined in#

system/core/backend/src/repositories/user.repository.ts:175


getPaged#

â–¸ getPaged(params?): Promise<TPagedList<User>>

Parameters#

NameType
params?TPagedParams<User>

Returns#

Promise<TPagedList<User>>

Inherited from#

BaseRepository.getPaged

Defined in#

system/core/backend/src/repositories/base.repository.ts:38


getSqlBoolStr#

â–¸ getSqlBoolStr(b): "true" | "false" | "1" | "0"

Parameters#

NameType
bboolean

Returns#

"true" | "false" | "1" | "0"

Inherited from#

BaseRepository.getSqlBoolStr

Defined in#

system/core/backend/src/repositories/base.repository.ts:34


getSqlLike#

â–¸ getSqlLike(): "ILIKE" | "LIKE"

Returns#

"ILIKE" | "LIKE"

Inherited from#

BaseRepository.getSqlLike

Defined in#

system/core/backend/src/repositories/base.repository.ts:35


getUserByEmail#

â–¸ getUserByEmail(email): Promise<undefined | User>

Parameters#

NameType
emailstring

Returns#

Promise<undefined | User>

Defined in#

system/core/backend/src/repositories/user.repository.ts:34


getUserById#

â–¸ getUserById(id): Promise<undefined | User>

Parameters#

NameType
idnumber

Returns#

Promise<undefined | User>

Defined in#

system/core/backend/src/repositories/user.repository.ts:29


getUserBySlug#

â–¸ getUserBySlug(slug): Promise<undefined | User>

Parameters#

NameType
slugstring

Returns#

Promise<undefined | User>

Defined in#

system/core/backend/src/repositories/user.repository.ts:44


getUsers#

â–¸ getUsers(params?): Promise<TPagedList<User>>

Parameters#

NameType
params?TPagedParams<User>

Returns#

Promise<TPagedList<User>>

Defined in#

system/core/backend/src/repositories/user.repository.ts:24


handleUserInput#

â–¸ handleUserInput(user, userInput, action): Promise<void>

Parameters#

NameType
userUser
userInputTUpdateUser
action"update" | "create"

Returns#

Promise<void>

Defined in#

system/core/backend/src/repositories/user.repository.ts:49


hashPassword#

â–¸ hashPassword(password): Promise<string>

Parameters#

NameType
passwordstring

Returns#

Promise<string>

Defined in#

system/core/backend/src/repositories/user.repository.ts:111


quote#

â–¸ quote(str): string

Parameters#

NameType
strstring

Returns#

string

Inherited from#

BaseRepository.quote

Defined in#

system/core/backend/src/repositories/base.repository.ts:36


updateEntity#

â–¸ updateEntity(id, input): Promise<User>

Parameters#

NameType
idnumber
inputUser

Returns#

Promise<User>

Inherited from#

BaseRepository.updateEntity

Defined in#

system/core/backend/src/repositories/base.repository.ts:82


updateUser#

â–¸ updateUser(id, updateUser): Promise<User>

Parameters#

NameType
idnumber
updateUserTUpdateUser

Returns#

Promise<User>

Defined in#

system/core/backend/src/repositories/user.repository.ts:115