@sourceloop/oidc-service / Exports / UserRepository
Class: UserRepository¶
Hierarchy¶
-
DefaultUserModifyCrudRepository
<User
, typeofid
,UserRelations
>↳
UserRepository
Table of contents¶
Constructors¶
Properties¶
- credentials
- getCurrentUser
- getOtpRepository
- logger
- tenant
- tenantRepositoryGetter
- userTenantRepositoryGetter
- userTenants
Methods¶
- changePassword
- create
- createAll
- createWithoutPassword
- firstTimeUser
- replaceById
- save
- update
- updateAll
- updateById
- updateLastLogin
- updatePassword
- verifyPassword
Constructors¶
constructor¶
• new UserRepository(dataSource
, getUserCredsRepository
, getOtpRepository
, getCurrentUser
, tenantRepositoryGetter
, userTenantRepositoryGetter
, logger
)
Parameters¶
Name | Type |
---|---|
dataSource |
DataSource |
getUserCredsRepository |
Getter <UserCredentialsRepository > |
getOtpRepository |
Getter <OtpRepository > |
getCurrentUser |
Getter <undefined | IAuthUserWithPermissions <string , string , string >> |
tenantRepositoryGetter |
Getter <TenantRepository > |
userTenantRepositoryGetter |
Getter <UserTenantRepository > |
logger |
ILogger |
Overrides¶
DefaultUserModifyCrudRepository< User, typeof User.prototype.id, UserRelations \>.constructor
Defined in¶
services/oidc-service/src/repositories/user.repository.ts:57
Properties¶
credentials¶
• Readonly
credentials: HasOneRepositoryFactory
<UserCredentials
, undefined
| string
>
Defined in¶
services/oidc-service/src/repositories/user.repository.ts:46
getCurrentUser¶
• Protected
Readonly
getCurrentUser: Getter
<undefined
| IAuthUserWithPermissions
<string
, string
, string
>>
Inherited from¶
DefaultUserModifyCrudRepository.getCurrentUser
Defined in¶
services/oidc-service/src/repositories/user.repository.ts:65
getOtpRepository¶
• getOtpRepository: Getter
<OtpRepository
>
Defined in¶
services/oidc-service/src/repositories/user.repository.ts:63
logger¶
• Private
Readonly
logger: ILogger
Defined in¶
services/oidc-service/src/repositories/user.repository.ts:72
tenant¶
• Readonly
tenant: BelongsToAccessor
<Tenant
, undefined
| string
>
Defined in¶
services/oidc-service/src/repositories/user.repository.ts:50
tenantRepositoryGetter¶
• Protected
tenantRepositoryGetter: Getter
<TenantRepository
>
Defined in¶
services/oidc-service/src/repositories/user.repository.ts:69
userTenantRepositoryGetter¶
• Protected
userTenantRepositoryGetter: Getter
<UserTenantRepository
>
Defined in¶
services/oidc-service/src/repositories/user.repository.ts:71
userTenants¶
• Readonly
userTenants: HasManyRepositoryFactory
<UserTenant
, undefined
| string
>
Defined in¶
services/oidc-service/src/repositories/user.repository.ts:52
Methods¶
changePassword¶
▸ changePassword(username
, newPassword
, oldPassword?
): Promise
<User
>
Parameters¶
Name | Type |
---|---|
username |
string |
newPassword |
string |
oldPassword? |
string |
Returns¶
Promise
<User
>
Defined in¶
services/oidc-service/src/repositories/user.repository.ts:176
create¶
▸ create(entity
, options?
): Promise
<User
>
Parameters¶
Name | Type |
---|---|
entity |
DataObject <User > |
options? |
AnyObject |
Returns¶
Promise
<User
>
Overrides¶
DefaultUserModifyCrudRepository.create
Defined in¶
services/oidc-service/src/repositories/user.repository.ts:102
createAll¶
▸ createAll(entities
, options?
): Promise
<User
[]>
Parameters¶
Name | Type |
---|---|
entities |
DataObject <User >[] |
options? |
Options |
Returns¶
Promise
<User
[]>
Inherited from¶
DefaultUserModifyCrudRepository.createAll
Defined in¶
packages/core/dist/repositories/default-user-modify-crud.repository.base.d.ts:12
createWithoutPassword¶
▸ createWithoutPassword(entity
, options?
): Promise
<User
>
Parameters¶
Name | Type |
---|---|
entity |
DataObject <User > |
options? |
AnyObject |
Returns¶
Promise
<User
>
Defined in¶
services/oidc-service/src/repositories/user.repository.ts:121
firstTimeUser¶
▸ firstTimeUser(userId
): Promise
<boolean
>
Parameters¶
Name | Type |
---|---|
userId |
string |
Returns¶
Promise
<boolean
>
Defined in¶
services/oidc-service/src/repositories/user.repository.ts:225
replaceById¶
▸ replaceById(id
, data
, options?
): Promise
<void
>
Parameters¶
Name | Type |
---|---|
id |
undefined | string |
data |
DataObject <User > |
options? |
Options |
Returns¶
Promise
<void
>
Inherited from¶
DefaultUserModifyCrudRepository.replaceById
Defined in¶
packages/core/dist/repositories/default-user-modify-crud.repository.base.d.ts:17
save¶
▸ save(entity
, options?
): Promise
<User
>
Parameters¶
Name | Type |
---|---|
entity |
User |
options? |
Options |
Returns¶
Promise
<User
>
Inherited from¶
DefaultUserModifyCrudRepository.save
Defined in¶
packages/core/dist/repositories/default-user-modify-crud.repository.base.d.ts:13
update¶
▸ update(entity
, options?
): Promise
<void
>
Parameters¶
Name | Type |
---|---|
entity |
User |
options? |
Options |
Returns¶
Promise
<void
>
Inherited from¶
DefaultUserModifyCrudRepository.update
Defined in¶
packages/core/dist/repositories/default-user-modify-crud.repository.base.d.ts:14
updateAll¶
▸ updateAll(data
, where?
, options?
): Promise
<Count
>
Parameters¶
Name | Type |
---|---|
data |
DataObject <User > |
where? |
Where <User > |
options? |
Options |
Returns¶
Promise
<Count
>
Inherited from¶
DefaultUserModifyCrudRepository.updateAll
Defined in¶
packages/core/dist/repositories/default-user-modify-crud.repository.base.d.ts:15
updateById¶
▸ updateById(id
, data
, options?
): Promise
<void
>
Parameters¶
Name | Type |
---|---|
id |
undefined | string |
data |
DataObject <User > |
options? |
Options |
Returns¶
Promise
<void
>
Inherited from¶
DefaultUserModifyCrudRepository.updateById
Defined in¶
packages/core/dist/repositories/default-user-modify-crud.repository.base.d.ts:16
updateLastLogin¶
▸ updateLastLogin(userId
): Promise
<void
>
Parameters¶
Name | Type |
---|---|
userId |
string |
Returns¶
Promise
<void
>
Defined in¶
services/oidc-service/src/repositories/user.repository.ts:213
updatePassword¶
▸ updatePassword(username
, password
, newPassword
): Promise
<User
>
Parameters¶
Name | Type |
---|---|
username |
string |
password |
string |
newPassword |
string |
Returns¶
Promise
<User
>
Defined in¶
services/oidc-service/src/repositories/user.repository.ts:147
verifyPassword¶
▸ verifyPassword(username
, password
): Promise
<User
>
Parameters¶
Name | Type |
---|---|
username |
string |
password |
string |
Returns¶
Promise
<User
>
Defined in¶
services/oidc-service/src/repositories/user.repository.ts:128