Class: UserCrudService
User CRUD service
Extends
Constructors
new UserCrudService()
new UserCrudService(
userRepo):UserCrudService
Constructor
Parameters
| Parameter | Type | Description |
|---|---|---|
userRepo | Repository<UserEntityInterface> | instance of the user repository. |
Returns
Overrides
TypeOrmCrudService.constructor
Defined in
.tmp/repos/rockets/packages/nestjs-user/src/services/user-crud.service.ts:18 (opens in a new tab)
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
alias | readonly | string | - | TypeOrmCrudService.alias |
count | readonly | (options?: FindManyOptions<UserEntityInterface>) => Promise<number> | - | TypeOrmCrudService.count |
crudQueryHelper | readonly | CrudQueryHelper | - | TypeOrmCrudService.crudQueryHelper |
dbName | protected | "mysql" | "mariadb" | "postgres" | "cockroachdb" | "sqlite" | "mssql" | "sap" | "oracle" | "cordova" | "nativescript" | "react-native" | "sqljs" | "mongodb" | "aurora-mysql" | "aurora-postgres" | "expo" | "better-sqlite3" | "capacitor" | "spanner" | - | TypeOrmCrudService.dbName |
entityColumns | protected | string[] | - | TypeOrmCrudService.entityColumns |
entityColumnsHash | protected | ObjectLiteral | - | TypeOrmCrudService.entityColumnsHash |
entityHasDeleteColumn | protected | boolean | - | TypeOrmCrudService.entityHasDeleteColumn |
entityPrimaryColumns | protected | string[] | - | TypeOrmCrudService.entityPrimaryColumns |
entityRelationsHash | protected | Map<string, IAllowedRelation> | - | TypeOrmCrudService.entityRelationsHash |
entityType | readonly | ClassType<UserEntityInterface> | - | TypeOrmCrudService.entityType |
find | readonly | (options?: FindManyOptions<UserEntityInterface>) => Promise<UserEntityInterface[]> | - | TypeOrmCrudService.find |
findOne | readonly | (options: FindOneOptions<UserEntityInterface>) => Promise<null | UserEntityInterface> | - | TypeOrmCrudService.findOne |
repo | protected | Repository<UserEntityInterface> | - | TypeOrmCrudService.repo |
sqlInjectionRegEx | protected | RegExp[] | - | TypeOrmCrudService.sqlInjectionRegEx |
userRepo | readonly | Repository<UserEntityInterface> | instance of the user repository. | - |
Methods
builderAddBrackets()
protectedbuilderAddBrackets(builder,condition,brackets):void
Parameters
| Parameter | Type |
|---|---|
builder | SelectQueryBuilder<UserEntityInterface> |
condition | SConditionKey |
brackets | Brackets |
Returns
void
Inherited from
TypeOrmCrudService.builderAddBrackets
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud-typeorm/lib/typeorm-crud.service.d.ts:53
builderSetWhere()
protectedbuilderSetWhere(builder,condition,field,value,operator?):void
Parameters
| Parameter | Type |
|---|---|
builder | SelectQueryBuilder<UserEntityInterface> |
condition | SConditionKey |
field | string |
value | any |
operator? | ComparisonOperator |
Returns
void
Inherited from
TypeOrmCrudService.builderSetWhere
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud-typeorm/lib/typeorm-crud.service.d.ts:54
createBuilder()
createBuilder(
parsed,options,many?,withDeleted?):Promise<SelectQueryBuilder<UserEntityInterface>>
Parameters
| Parameter | Type |
|---|---|
parsed | ParsedRequestParams |
options | CrudRequestOptions |
many? | boolean |
withDeleted? | boolean |
Returns
Promise<SelectQueryBuilder<UserEntityInterface>>
Inherited from
TypeOrmCrudService.createBuilder
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud-typeorm/lib/typeorm-crud.service.d.ts:38
createMany()
createMany(
req,dto,queryOptions?):Promise<UserEntityInterface[]>
Parameters
| Parameter | Type |
|---|---|
req | CrudRequest |
dto | CreateManyDto<DeepPartial<UserEntityInterface>> |
queryOptions? | CrudQueryOptionsInterface |
Returns
Promise<UserEntityInterface[]>
Inherited from
Defined in
.tmp/repos/rockets/packages/nestjs-crud/dist/services/typeorm-crud.service.d.ts:15
createOne()
createOne(
req,dto,queryOptions?):Promise<UserEntityInterface>
Parameters
| Parameter | Type |
|---|---|
req | CrudRequest |
dto | DeepPartial<UserEntityInterface> |
queryOptions? | CrudQueryOptionsInterface |
Returns
Promise<UserEntityInterface>
Inherited from
Defined in
.tmp/repos/rockets/packages/nestjs-crud/dist/services/typeorm-crud.service.d.ts:16
createPageInfo()
createPageInfo(
data,total,limit,offset):GetManyDefaultResponse<UserEntityInterface>
Parameters
| Parameter | Type |
|---|---|
data | UserEntityInterface[] |
total | number |
limit | number |
offset | number |
Returns
GetManyDefaultResponse<UserEntityInterface>
Inherited from
TypeOrmCrudService.createPageInfo
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud/lib/services/crud-service.abstract.d.ts:15
decidePagination()
decidePagination(
parsed,options):boolean
Parameters
| Parameter | Type |
|---|---|
parsed | ParsedRequestParams |
options | CrudRequestOptions |
Returns
boolean
Inherited from
TypeOrmCrudService.decidePagination
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud/lib/services/crud-service.abstract.d.ts:16
deleteOne()
deleteOne(
req,queryOptions?):Promise<void|UserEntityInterface>
Parameters
| Parameter | Type |
|---|---|
req | CrudRequest |
queryOptions? | CrudQueryOptionsInterface |
Returns
Promise<void | UserEntityInterface>
Inherited from
Defined in
.tmp/repos/rockets/packages/nestjs-crud/dist/services/typeorm-crud.service.d.ts:19
doGetMany()
protecteddoGetMany(builder,query,options):Promise<UserEntityInterface[] |GetManyDefaultResponse<UserEntityInterface>>
Parameters
| Parameter | Type |
|---|---|
builder | SelectQueryBuilder<UserEntityInterface> |
query | ParsedRequestParams |
options | CrudRequestOptions |
Returns
Promise<UserEntityInterface[] | GetManyDefaultResponse<UserEntityInterface>>
Inherited from
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud-typeorm/lib/typeorm-crud.service.d.ts:39
getAllowedColumns()
protectedgetAllowedColumns(columns,options):string[]
Parameters
| Parameter | Type |
|---|---|
columns | string[] |
options | QueryOptions |
Returns
string[]
Inherited from
TypeOrmCrudService.getAllowedColumns
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud-typeorm/lib/typeorm-crud.service.d.ts:43
getEntityColumns()
protectedgetEntityColumns(entityMetadata):object
Parameters
| Parameter | Type |
|---|---|
entityMetadata | EntityMetadata |
Returns
object
| Name | Type |
|---|---|
columns | string[] |
primaryColumns | string[] |
Inherited from
TypeOrmCrudService.getEntityColumns
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud-typeorm/lib/typeorm-crud.service.d.ts:44
getFieldWithAlias()
protectedgetFieldWithAlias(field,sort?):string
Parameters
| Parameter | Type |
|---|---|
field | string |
sort? | boolean |
Returns
string
Inherited from
TypeOrmCrudService.getFieldWithAlias
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud-typeorm/lib/typeorm-crud.service.d.ts:58
getMany()
getMany(
req,queryOptions?):Promise<UserEntityInterface[] |CrudResultPaginatedInterface<UserEntityInterface>>
Parameters
| Parameter | Type |
|---|---|
req | CrudRequest |
queryOptions? | CrudQueryOptionsInterface |
Returns
Promise<UserEntityInterface[] | CrudResultPaginatedInterface<UserEntityInterface>>
Inherited from
Defined in
.tmp/repos/rockets/packages/nestjs-crud/dist/services/typeorm-crud.service.d.ts:13
getOne()
getOne(
req,queryOptions?):Promise<UserEntityInterface>
Parameters
| Parameter | Type |
|---|---|
req | CrudRequest |
queryOptions? | CrudQueryOptionsInterface |
Returns
Promise<UserEntityInterface>
Inherited from
Defined in
.tmp/repos/rockets/packages/nestjs-crud/dist/services/typeorm-crud.service.d.ts:14
getOneOrFail()
protectedgetOneOrFail(req,shallow?,withDeleted?):Promise<UserEntityInterface>
Parameters
| Parameter | Type |
|---|---|
req | CrudRequest |
shallow? | boolean |
withDeleted? | boolean |
Returns
Promise<UserEntityInterface>
Inherited from
TypeOrmCrudService.getOneOrFail
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud-typeorm/lib/typeorm-crud.service.d.ts:41
getParamFilters()
getParamFilters(
parsed):ObjectLiteral
Parameters
| Parameter | Type |
|---|---|
parsed | ParsedRequestParams |
Returns
ObjectLiteral
Inherited from
TypeOrmCrudService.getParamFilters
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud-typeorm/lib/typeorm-crud.service.d.ts:37
getPrimaryParams()
getPrimaryParams(
options):string[]
Parameters
| Parameter | Type |
|---|---|
options | CrudRequestOptions |
Returns
string[]
Inherited from
TypeOrmCrudService.getPrimaryParams
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud/lib/services/crud-service.abstract.d.ts:19
getRelationMetadata()
protectedgetRelationMetadata(field,options):IAllowedRelation
Parameters
| Parameter | Type |
|---|---|
field | string |
options | JoinOption |
Returns
IAllowedRelation
Inherited from
TypeOrmCrudService.getRelationMetadata
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud-typeorm/lib/typeorm-crud.service.d.ts:48
getSelect()
protectedgetSelect(query,options):string[]
Parameters
| Parameter | Type |
|---|---|
query | ParsedRequestParams |
options | QueryOptions |
Returns
string[]
Inherited from
Defined in
.tmp/repos/rockets/packages/nestjs-crud/dist/services/typeorm-crud.service.d.ts:23
getSkip()
getSkip(
query,take):null|number
Parameters
| Parameter | Type |
|---|---|
query | ParsedRequestParams |
take | number |
Returns
null | number
Inherited from
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud/lib/services/crud-service.abstract.d.ts:18
getSort()
protectedgetSort(query,options):ObjectLiteral
Parameters
| Parameter | Type |
|---|---|
query | ParsedRequestParams |
options | QueryOptions |
Returns
ObjectLiteral
Inherited from
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud-typeorm/lib/typeorm-crud.service.d.ts:57
getTake()
getTake(
query,options):null|number
Parameters
| Parameter | Type |
|---|---|
query | ParsedRequestParams |
options | QueryOptions |
Returns
null | number
Inherited from
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud/lib/services/crud-service.abstract.d.ts:17
mapOperatorsToQuery()
protectedmapOperatorsToQuery(cond,param):object
Parameters
| Parameter | Type |
|---|---|
cond | QueryFilter |
param | any |
Returns
object
| Name | Type |
|---|---|
params | ObjectLiteral |
str | string |
Inherited from
TypeOrmCrudService.mapOperatorsToQuery
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud-typeorm/lib/typeorm-crud.service.d.ts:60
mapSort()
protectedmapSort(sort):ObjectLiteral
Parameters
| Parameter | Type |
|---|---|
sort | QuerySort[] |
Returns
ObjectLiteral
Inherited from
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud-typeorm/lib/typeorm-crud.service.d.ts:59
onInitMapEntityColumns()
protectedonInitMapEntityColumns():void
Returns
void
Inherited from
TypeOrmCrudService.onInitMapEntityColumns
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud-typeorm/lib/typeorm-crud.service.d.ts:40
prepareEntityBeforeSave()
protectedprepareEntityBeforeSave(dto,parsed):UserEntityInterface
Parameters
| Parameter | Type |
|---|---|
dto | DeepPartial<UserEntityInterface> |
parsed | ParsedRequestParams |
Returns
Inherited from
TypeOrmCrudService.prepareEntityBeforeSave
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud-typeorm/lib/typeorm-crud.service.d.ts:42
recoverOne()
recoverOne(
req,queryOptions?):Promise<UserEntityInterface>
Parameters
| Parameter | Type |
|---|---|
req | CrudRequest |
queryOptions? | CrudQueryOptionsInterface |
Returns
Promise<UserEntityInterface>
Inherited from
Defined in
.tmp/repos/rockets/packages/nestjs-crud/dist/services/typeorm-crud.service.d.ts:20
replaceOne()
replaceOne(
req,dto,queryOptions?):Promise<UserEntityInterface>
Parameters
| Parameter | Type |
|---|---|
req | CrudRequest |
dto | DeepPartial<UserEntityInterface> |
queryOptions? | CrudQueryOptionsInterface |
Returns
Promise<UserEntityInterface>
Inherited from
Defined in
.tmp/repos/rockets/packages/nestjs-crud/dist/services/typeorm-crud.service.d.ts:18
setAndWhere()
protectedsetAndWhere(cond,i,builder):void
Parameters
| Parameter | Type |
|---|---|
cond | QueryFilter |
i | any |
builder | SelectQueryBuilder<UserEntityInterface> | WhereExpression |
Returns
void
Inherited from
TypeOrmCrudService.setAndWhere
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud-typeorm/lib/typeorm-crud.service.d.ts:50
setJoin()
protectedsetJoin(cond,joinOptions,builder):boolean
Parameters
| Parameter | Type |
|---|---|
cond | QueryJoin |
joinOptions | JoinOptions |
builder | SelectQueryBuilder<UserEntityInterface> |
Returns
boolean
Inherited from
Defined in
.tmp/repos/rockets/packages/nestjs-crud/dist/services/typeorm-crud.service.d.ts:22
setOrWhere()
protectedsetOrWhere(cond,i,builder):void
Parameters
| Parameter | Type |
|---|---|
cond | QueryFilter |
i | any |
builder | SelectQueryBuilder<UserEntityInterface> | WhereExpression |
Returns
void
Inherited from
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud-typeorm/lib/typeorm-crud.service.d.ts:51
setSearchCondition()
protectedsetSearchCondition(builder,search,condition?):void
Parameters
| Parameter | Type |
|---|---|
builder | SelectQueryBuilder<UserEntityInterface> |
search | SCondition |
condition? | SConditionKey |
Returns
void
Inherited from
TypeOrmCrudService.setSearchCondition
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud-typeorm/lib/typeorm-crud.service.d.ts:52
setSearchFieldObjectCondition()
protectedsetSearchFieldObjectCondition(builder,condition,field,object):void
Parameters
| Parameter | Type |
|---|---|
builder | SelectQueryBuilder<UserEntityInterface> |
condition | SConditionKey |
field | string |
object | any |
Returns
void
Inherited from
TypeOrmCrudService.setSearchFieldObjectCondition
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud-typeorm/lib/typeorm-crud.service.d.ts:55
throwBadRequestException()
throwBadRequestException(
msg?):BadRequestException
Parameters
| Parameter | Type |
|---|---|
msg? | any |
Returns
BadRequestException
Inherited from
TypeOrmCrudService.throwBadRequestException
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud/lib/services/crud-service.abstract.d.ts:13
throwNotFoundException()
throwNotFoundException(
name):NotFoundException
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
NotFoundException
Inherited from
TypeOrmCrudService.throwNotFoundException
Defined in
.tmp/repos/rockets/node_modules/@nestjsx/crud/lib/services/crud-service.abstract.d.ts:14
transaction()
transaction(
options?):TransactionProxy
Parameters
| Parameter | Type |
|---|---|
options? | SafeTransactionOptionsInterface |
Returns
Inherited from
TypeOrmCrudService.transaction
Defined in
.tmp/repos/rockets/packages/nestjs-crud/dist/services/typeorm-crud.service.d.ts:21
updateOne()
updateOne(
req,dto,queryOptions?):Promise<UserEntityInterface>
Parameters
| Parameter | Type |
|---|---|
req | CrudRequest |
dto | DeepPartial<UserEntityInterface> |
queryOptions? | CrudQueryOptionsInterface |
Returns
Promise<UserEntityInterface>
Inherited from
Defined in
.tmp/repos/rockets/packages/nestjs-crud/dist/services/typeorm-crud.service.d.ts:17