Skip to content

@sourceloop/user-tenant-service / Exports / UserRepository

Class: UserRepository

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new UserRepository(dataSource, tenantRepositoryGetter, userCredentialsRepositoryGetter, userTenantRepositoryGetter, user, getCurrentUser)

Parameters

Name Type
dataSource DataSource
tenantRepositoryGetter Getter<TenantRepository>
userCredentialsRepositoryGetter Getter<UserCredentialsRepository>
userTenantRepositoryGetter Getter<UserTenantRepository>
user typeof Entity & { prototype: User<DataObject<Model>> }
getCurrentUser Getter<undefined | IAuthUserWithPermissions<string, string, string>>

Overrides

DefaultUserModifyCrudRepository< User, typeof User.prototype.id, UserRelations \>.constructor

Defined in

services/user-tenant-service/src/repositories/user.repository.ts:54

Properties

credentials

Readonly credentials: HasOneRepositoryFactory<UserCredentials, string>

Defined in

services/user-tenant-service/src/repositories/user.repository.ts:44


defaultTenant

Readonly defaultTenant: BelongsToAccessor<Tenant, string>

Defined in

services/user-tenant-service/src/repositories/user.repository.ts:39


getCurrentUser

Protected Readonly getCurrentUser: Getter<undefined | IAuthUserWithPermissions<string, string, string>>

Inherited from

DefaultUserModifyCrudRepository.getCurrentUser

Defined in

services/user-tenant-service/src/repositories/user.repository.ts:66


tenantRepositoryGetter

Protected tenantRepositoryGetter: Getter<TenantRepository>

Defined in

services/user-tenant-service/src/repositories/user.repository.ts:58


user

Private Readonly user: typeof Entity & { prototype: User<DataObject<Model>> }

Defined in

services/user-tenant-service/src/repositories/user.repository.ts:64


userCredentialsRepositoryGetter

Protected userCredentialsRepositoryGetter: Getter<UserCredentialsRepository>

Defined in

services/user-tenant-service/src/repositories/user.repository.ts:60


userTenantRepositoryGetter

Protected userTenantRepositoryGetter: Getter<UserTenantRepository>

Defined in

services/user-tenant-service/src/repositories/user.repository.ts:62


userTenants

Readonly userTenants: HasManyRepositoryFactory<UserTenant, string>

Defined in

services/user-tenant-service/src/repositories/user.repository.ts:49

Methods

create

create(entity, options?): Promise<User<DataObject<Model>>>

Parameters

Name Type
entity DataObject<User<DataObject<Model>>>
options? AnyObject

Returns

Promise<User<DataObject<Model>>>

Overrides

DefaultUserModifyCrudRepository.create

Defined in

services/user-tenant-service/src/repositories/user.repository.ts:97


createAll

createAll(entities, options?): Promise<User<DataObject<Model>>[]>

Parameters

Name Type
entities DataObject<User<DataObject<Model>>>[]
options? Options

Returns

Promise<User<DataObject<Model>>[]>

Inherited from

DefaultUserModifyCrudRepository.createAll

Defined in

packages/core/dist/repositories/default-user-modify-crud.repository.base.d.ts:12


replaceById

replaceById(id, data, options?): Promise<void>

Parameters

Name Type
id string
data DataObject<User<DataObject<Model>>>
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<DataObject<Model>>>

Parameters

Name Type
entity User<DataObject<Model>>
options? Options

Returns

Promise<User<DataObject<Model>>>

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<DataObject<Model>>
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<DataObject<Model>>>
where? Where<User<DataObject<Model>>>
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 string
data DataObject<User<DataObject<Model>>>
options? Options

Returns

Promise<void>

Inherited from

DefaultUserModifyCrudRepository.updateById

Defined in

packages/core/dist/repositories/default-user-modify-crud.repository.base.d.ts:16