Class: abstract MutateService<Entity, Creatable, Updatable, Replaceable, Removable>
Abstract mutate service
Extends
BaseService<Entity>
Extended by
Type Parameters
| Type Parameter | Default type |
|---|---|
Entity extends ReferenceIdInterface | - |
Creatable extends DeepPartial<Entity> | - |
Updatable extends DeepPartial<Entity> | - |
Replaceable extends Creatable | Creatable |
Removable extends DeepPartial<Entity> | DeepPartial<Entity> |
Implements
CreateOneInterface<Creatable,Entity>UpdateOneInterface<Updatable&ReferenceIdInterface,Entity>ReplaceOneInterface<Replaceable&ReferenceIdInterface,Entity>RemoveOneInterface<Removable&ReferenceIdInterface,Entity>
Constructors
new MutateService()
new MutateService<
Entity,Creatable,Updatable,Replaceable,Removable>(repo):MutateService<Entity,Creatable,Updatable,Replaceable,Removable>
Constructor
Parameters
| Parameter | Type | Description |
|---|---|---|
repo | Repository<Entity> | instance of the repo |
Returns
MutateService<Entity, Creatable, Updatable, Replaceable, Removable>
Overrides
Defined in
.tmp/repos/rockets/packages/typeorm-common/src/services/mutate.service.ts:44 (opens in a new tab)
Properties
| Property | Modifier | Type |
|---|---|---|
createDto | abstract | Type<Creatable> |
updateDto | abstract | Type<Updatable> |
Accessors
metadata
getprotectedmetadata():EntityMetadata
Internal
Returns
EntityMetadata
Inherited from
Defined in
.tmp/repos/rockets/packages/typeorm-common/src/services/base.service.ts:87 (opens in a new tab)
Methods
create()
create(
data,queryOptions?):Promise<Entity>
Create one
Parameters
| Parameter | Type | Description |
|---|---|---|
data | Creatable | the reference to create |
queryOptions? | QueryOptionsInterface | - |
Returns
Promise<Entity>
the created reference
Implementation of
CreateOneInterface.create
Defined in
.tmp/repos/rockets/packages/typeorm-common/src/services/mutate.service.ts:54 (opens in a new tab)
find()
find(
options,queryOptions?):Promise<Promise<Entity[]>>
Find wrapper.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | FindManyOptions<Entity> | Find many options |
queryOptions? | QueryOptionsInterface | Query options |
Returns
Promise<Promise<Entity[]>>
Inherited from
Defined in
.tmp/repos/rockets/packages/typeorm-common/src/services/base.service.ts:32 (opens in a new tab)
findById()
protectedfindById(id,queryOptions?):Promise<Entity>
Internal
Parameters
| Parameter | Type |
|---|---|
id | string |
queryOptions? | QueryOptionsInterface |
Returns
Promise<Entity>
Defined in
.tmp/repos/rockets/packages/typeorm-common/src/services/mutate.service.ts:203 (opens in a new tab)
findOne()
findOne(
options,queryOptions?):Promise<null|Entity>
Find One wrapper.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | FindOneOptions<Entity> | Find one options |
queryOptions? | QueryOptionsInterface | Query options |
Returns
Promise<null | Entity>
Inherited from
Defined in
.tmp/repos/rockets/packages/typeorm-common/src/services/base.service.ts:51 (opens in a new tab)
remove()
remove(
data,queryOptions?):Promise<Entity>
Remove one
Parameters
| Parameter | Type | Description |
|---|---|---|
data | Removable & ReferenceIdInterface<string> | the reference data to remove |
queryOptions? | QueryOptionsInterface | query options |
Returns
Promise<Entity>
the removed reference
Implementation of
RemoveOneInterface.remove
Defined in
.tmp/repos/rockets/packages/typeorm-common/src/services/mutate.service.ts:125 (opens in a new tab)
replace()
replace(
data,queryOptions?):Promise<Entity>
Replace one
Parameters
| Parameter | Type | Description |
|---|---|---|
data | Replaceable & ReferenceIdInterface<string> | the reference data to replace |
queryOptions? | QueryOptionsInterface | - |
Returns
Promise<Entity>
the replaced reference
Implementation of
ReplaceOneInterface.replace
Defined in
.tmp/repos/rockets/packages/typeorm-common/src/services/mutate.service.ts:99 (opens in a new tab)
repository()
repository(
queryOptions?):Repository<Entity>
Return the correct repository instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
queryOptions? | QueryOptionsInterface | Options |
Returns
Repository<Entity>
Inherited from
Defined in
.tmp/repos/rockets/packages/typeorm-common/src/services/base.service.ts:69 (opens in a new tab)
transaction()
transaction(
options?):TransactionProxy
Return a transaction instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | SafeTransactionOptionsInterface | Options |
Returns
Inherited from
Defined in
.tmp/repos/rockets/packages/typeorm-common/src/services/base.service.ts:78 (opens in a new tab)
transform()
protectedtransform(data,_queryOptions?):Promise<DeepPartial<Entity>>
Internal
Parameters
| Parameter | Type |
|---|---|
data | DeepPartial<Entity> |
_queryOptions? | QueryOptionsInterface |
Returns
Promise<DeepPartial<Entity>>
Defined in
.tmp/repos/rockets/packages/typeorm-common/src/services/mutate.service.ts:193 (opens in a new tab)
update()
update(
data,queryOptions?):Promise<Entity>
Update one
Parameters
| Parameter | Type | Description |
|---|---|---|
data | Updatable & ReferenceIdInterface<string> | the reference data to update |
queryOptions? | QueryOptionsInterface | - |
Returns
Promise<Entity>
the updated reference
Implementation of
UpdateOneInterface.update
Defined in
.tmp/repos/rockets/packages/typeorm-common/src/services/mutate.service.ts:74 (opens in a new tab)
validate()
protectedvalidate<T>(type,data):Promise<T>
Internal
Type Parameters
| Type Parameter |
|---|
T extends ReferenceIdInterface<string> | object |
Parameters
| Parameter | Type |
|---|---|
type | Type<T> |
data | T |
Returns
Promise<T>
Defined in
.tmp/repos/rockets/packages/typeorm-common/src/services/mutate.service.ts:168 (opens in a new tab)