API Reference
Rockets Core API
typeorm-common
classes
MutateService

Class: abstract MutateService<Entity, Creatable, Updatable, Replaceable, Removable>

Abstract mutate service

Extends

Extended by

Type Parameters

Type ParameterDefault type
Entity extends ReferenceIdInterface-
Creatable extends DeepPartial<Entity>-
Updatable extends DeepPartial<Entity>-
Replaceable extends CreatableCreatable
Removable extends DeepPartial<Entity>DeepPartial<Entity>

Implements

Constructors

new MutateService()

new MutateService<Entity, Creatable, Updatable, Replaceable, Removable>(repo): MutateService<Entity, Creatable, Updatable, Replaceable, Removable>

Constructor

Parameters

ParameterTypeDescription
repoRepository<Entity>instance of the repo

Returns

MutateService<Entity, Creatable, Updatable, Replaceable, Removable>

Overrides

BaseService.constructor

Defined in

.tmp/repos/rockets/packages/typeorm-common/src/services/mutate.service.ts:44 (opens in a new tab)

Properties

PropertyModifierType
createDtoabstractType<Creatable>
updateDtoabstractType<Updatable>

Accessors

metadata

get protected metadata(): EntityMetadata

Internal

Returns

EntityMetadata

Inherited from

BaseService.metadata

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

ParameterTypeDescription
dataCreatablethe 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

ParameterTypeDescription
optionsFindManyOptions<Entity>Find many options
queryOptions?QueryOptionsInterfaceQuery options

Returns

Promise<Promise<Entity[]>>

Inherited from

BaseService.find

Defined in

.tmp/repos/rockets/packages/typeorm-common/src/services/base.service.ts:32 (opens in a new tab)


findById()

protected findById(id, queryOptions?): Promise<Entity>

Internal

Parameters

ParameterType
idstring
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

ParameterTypeDescription
optionsFindOneOptions<Entity>Find one options
queryOptions?QueryOptionsInterfaceQuery options

Returns

Promise<null | Entity>

Inherited from

BaseService.findOne

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

ParameterTypeDescription
dataRemovable & ReferenceIdInterface<string>the reference data to remove
queryOptions?QueryOptionsInterfacequery 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

ParameterTypeDescription
dataReplaceable & 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

ParameterTypeDescription
queryOptions?QueryOptionsInterfaceOptions

Returns

Repository<Entity>

Inherited from

BaseService.repository

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

ParameterTypeDescription
options?SafeTransactionOptionsInterfaceOptions

Returns

TransactionProxy

Inherited from

BaseService.transaction

Defined in

.tmp/repos/rockets/packages/typeorm-common/src/services/base.service.ts:78 (opens in a new tab)


transform()

protected transform(data, _queryOptions?): Promise<DeepPartial<Entity>>

Internal

Parameters

ParameterType
dataDeepPartial<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

ParameterTypeDescription
dataUpdatable & 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()

protected validate<T>(type, data): Promise<T>

Internal

Type Parameters

Type Parameter
T extends ReferenceIdInterface<string> | object

Parameters

ParameterType
typeType<T>
dataT

Returns

Promise<T>

Defined in

.tmp/repos/rockets/packages/typeorm-common/src/services/mutate.service.ts:168 (opens in a new tab)