Skip to main content

Class: StrategyInstanceService

model/services/strategy-instance.service.StrategyInstanceService

Hierarchy

Constructors

constructor

new StrategyInstanceService(dataSource)

Parameters

NameType
dataSourceDataSource

Overrides

Repository<StrategyInstance\>.constructor

Defined in

gropius-login-service/backend/src/model/services/strategy-instance.service.ts:7

Properties

dataSource

Private dataSource: DataSource

Defined in

gropius-login-service/backend/src/model/services/strategy-instance.service.ts:7


manager

Readonly manager: EntityManager

Entity Manager used by this repository.

Inherited from

Repository.manager

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:32


queryRunner

Optional Readonly queryRunner: QueryRunner

Query runner provider used for this repository.

Inherited from

Repository.queryRunner

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:36


target

Readonly target: EntityTarget<StrategyInstance>

Entity target that is managed by this repository. If this repository manages entity from schema, then it returns a name of that schema instead.

Inherited from

Repository.target

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:28

Accessors

metadata

get metadata(): EntityMetadata

Entity metadata of the entity current repository manages.

Returns

EntityMetadata

Inherited from

Repository.metadata

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:40

Methods

average

average(columnName, where?): Promise<number>

Return the AVG of a column

Parameters

NameType
columnNamenever
where?FindOptionsWhere<StrategyInstance> | FindOptionsWhere<StrategyInstance>[]

Returns

Promise<number>

Inherited from

Repository.average

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:229


clear

clear(): Promise<void>

Clears all the data from the given table/collection (truncates/drops it).

Note: this method uses TRUNCATE and may not work as you expect in transactions on some platforms.

Returns

Promise<void>

See

https://stackoverflow.com/a/5972738/925151

Inherited from

Repository.clear

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:311


count

count(options?): Promise<number>

Counts entities that match given options. Useful for pagination.

Parameters

NameType
options?FindManyOptions<StrategyInstance>

Returns

Promise<number>

Inherited from

Repository.count

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:216


countAllByTypeNotIn

countAllByTypeNotIn(types): Promise<number>

Parameters

NameType
typesstring[]

Returns

Promise<number>

Defined in

gropius-login-service/backend/src/model/services/strategy-instance.service.ts:11


countBy

countBy(where): Promise<number>

Counts entities that match given conditions. Useful for pagination.

Parameters

NameType
whereFindOptionsWhere<StrategyInstance> | FindOptionsWhere<StrategyInstance>[]

Returns

Promise<number>

Inherited from

Repository.countBy

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:221


create

create(): StrategyInstance

Creates a new entity instance.

Returns

StrategyInstance

Inherited from

Repository.create

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:58

create(entityLikeArray): StrategyInstance[]

Creates new entities and copies all entity properties from given objects into their new entities. Note that it copies only properties that are present in entity schema.

Parameters

NameType
entityLikeArrayDeepPartial<StrategyInstance>[]

Returns

StrategyInstance[]

Inherited from

Repository.create

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:63

create(entityLike): StrategyInstance

Creates a new entity instance and copies all entity properties from this object into a new entity. Note that it copies only properties that are present in entity schema.

Parameters

NameType
entityLikeDeepPartial<StrategyInstance>

Returns

StrategyInstance

Inherited from

Repository.create

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:68


createQueryBuilder

createQueryBuilder(alias?, queryRunner?): SelectQueryBuilder<StrategyInstance>

Creates a new query builder that can be used to build a SQL query.

Parameters

NameType
alias?string
queryRunner?QueryRunner

Returns

SelectQueryBuilder<StrategyInstance>

Inherited from

Repository.createQueryBuilder

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:45


decrement

decrement(conditions, propertyPath, value): Promise<UpdateResult>

Decrements some column by provided value of the entities matched given conditions.

Parameters

NameType
conditionsFindOptionsWhere<StrategyInstance>
propertyPathstring
valuestring | number

Returns

Promise<UpdateResult>

Inherited from

Repository.decrement

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:319


delete

delete(criteria): Promise<DeleteResult>

Deletes entities by a given criteria. Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient DELETE query. Does not check if entity exist in the database.

Parameters

NameType
criteriastring | number | string[] | number[] | Date | FindOptionsWhere<StrategyInstance> | ObjectId | Date[] | ObjectId[]

Returns

Promise<DeleteResult>

Inherited from

Repository.delete

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:181


exist

exist(options?): Promise<boolean>

Checks whether any entity exists that matches the given options.

Parameters

NameType
options?FindManyOptions<StrategyInstance>

Returns

Promise<boolean>

Deprecated

use exists method instead, for example:

.exists()

Inherited from

Repository.exist

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:203


exists

exists(options?): Promise<boolean>

Checks whether any entity exists that matches the given options.

Parameters

NameType
options?FindManyOptions<StrategyInstance>

Returns

Promise<boolean>

Inherited from

Repository.exists

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:207


existsBy

existsBy(where): Promise<boolean>

Checks whether any entity exists that matches the given conditions.

Parameters

NameType
whereFindOptionsWhere<StrategyInstance> | FindOptionsWhere<StrategyInstance>[]

Returns

Promise<boolean>

Inherited from

Repository.existsBy

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:211


extend

extend<CustomRepository>(customs): StrategyInstanceService & CustomRepository

Extends repository with provided functions.

Type parameters

Name
CustomRepository

Parameters

NameType
customsCustomRepository & ThisType<StrategyInstanceService & CustomRepository>

Returns

StrategyInstanceService & CustomRepository

Inherited from

Repository.extend

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:323


find

find(options?): Promise<StrategyInstance[]>

Finds entities that match given find options.

Parameters

NameType
options?FindManyOptions<StrategyInstance>

Returns

Promise<StrategyInstance[]>

Inherited from

Repository.find

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:241


findAndCount

findAndCount(options?): Promise<[StrategyInstance[], number]>

Finds entities that match given find options. Also counts all entities that match given conditions, but ignores pagination settings (from and take options).

Parameters

NameType
options?FindManyOptions<StrategyInstance>

Returns

Promise<[StrategyInstance[], number]>

Inherited from

Repository.findAndCount

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:251


findAndCountBy

findAndCountBy(where): Promise<[StrategyInstance[], number]>

Finds entities that match given WHERE conditions. Also counts all entities that match given conditions, but ignores pagination settings (from and take options).

Parameters

NameType
whereFindOptionsWhere<StrategyInstance> | FindOptionsWhere<StrategyInstance>[]

Returns

Promise<[StrategyInstance[], number]>

Inherited from

Repository.findAndCountBy

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:257


findBy

findBy(where): Promise<StrategyInstance[]>

Finds entities that match given find options.

Parameters

NameType
whereFindOptionsWhere<StrategyInstance> | FindOptionsWhere<StrategyInstance>[]

Returns

Promise<StrategyInstance[]>

Inherited from

Repository.findBy

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:245


findByIds

findByIds(ids): Promise<StrategyInstance[]>

Finds entities with ids. Optionally find options or conditions can be applied.

Parameters

NameType
idsany[]

Returns

Promise<StrategyInstance[]>

Deprecated

use findBy method instead in conjunction with In operator, for example:

.findBy({ id: In([1, 2, 3]) })

Inherited from

Repository.findByIds

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:268


findOne

findOne(options): Promise<StrategyInstance>

Finds first entity by a given find options. If entity was not found in the database - returns null.

Parameters

NameType
optionsFindOneOptions<StrategyInstance>

Returns

Promise<StrategyInstance>

Inherited from

Repository.findOne

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:273


findOneBy

findOneBy(where): Promise<StrategyInstance>

Finds first entity that matches given where condition. If entity was not found in the database - returns null.

Parameters

NameType
whereFindOptionsWhere<StrategyInstance> | FindOptionsWhere<StrategyInstance>[]

Returns

Promise<StrategyInstance>

Inherited from

Repository.findOneBy

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:278


findOneById

findOneById(id): Promise<StrategyInstance>

Finds first entity that matches given id. If entity was not found in the database - returns null.

Parameters

NameType
idstring | number | Date | ObjectId

Returns

Promise<StrategyInstance>

Deprecated

use findOneBy method instead in conjunction with In operator, for example:

.findOneBy({ id: 1 // where "id" is your primary column name })

Inherited from

Repository.findOneById

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:289


findOneByOrFail

findOneByOrFail(where): Promise<StrategyInstance>

Finds first entity that matches given where condition. If entity was not found in the database - rejects with error.

Parameters

NameType
whereFindOptionsWhere<StrategyInstance> | FindOptionsWhere<StrategyInstance>[]

Returns

Promise<StrategyInstance>

Inherited from

Repository.findOneByOrFail

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:299


findOneOrFail

findOneOrFail(options): Promise<StrategyInstance>

Finds first entity by a given find options. If entity was not found in the database - rejects with error.

Parameters

NameType
optionsFindOneOptions<StrategyInstance>

Returns

Promise<StrategyInstance>

Inherited from

Repository.findOneOrFail

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:294


getId

getId(entity): any

Gets entity mixed id.

Parameters

NameType
entityStrategyInstance

Returns

any

Inherited from

Repository.getId

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:54


hasId

hasId(entity): boolean

Checks if entity has an id. If entity composite compose ids, it will check them all.

Parameters

NameType
entityStrategyInstance

Returns

boolean

Inherited from

Repository.hasId

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:50


increment

increment(conditions, propertyPath, value): Promise<UpdateResult>

Increments some column by provided value of the entities matched given conditions.

Parameters

NameType
conditionsFindOptionsWhere<StrategyInstance>
propertyPathstring
valuestring | number

Returns

Promise<UpdateResult>

Inherited from

Repository.increment

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:315


insert

insert(entity): Promise<InsertResult>

Inserts a given entity into the database. Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient INSERT query. Does not check if entity exist in the database, so query will fail if duplicate entity is being inserted.

Parameters

NameType
entity_QueryDeepPartialEntity<StrategyInstance> | _QueryDeepPartialEntity<StrategyInstance>[]

Returns

Promise<InsertResult>

Inherited from

Repository.insert

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:161


maximum

maximum(columnName, where?): Promise<number>

Return the MAX of a column

Parameters

NameType
columnNamenever
where?FindOptionsWhere<StrategyInstance> | FindOptionsWhere<StrategyInstance>[]

Returns

Promise<number>

Inherited from

Repository.maximum

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:237


merge

merge(mergeIntoEntity, ...entityLikes): StrategyInstance

Merges multiple entities (or entity-like objects) into a given entity.

Parameters

NameType
mergeIntoEntityStrategyInstance
...entityLikesDeepPartial<StrategyInstance>[]

Returns

StrategyInstance

Inherited from

Repository.merge

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:72


minimum

minimum(columnName, where?): Promise<number>

Return the MIN of a column

Parameters

NameType
columnNamenever
where?FindOptionsWhere<StrategyInstance> | FindOptionsWhere<StrategyInstance>[]

Returns

Promise<number>

Inherited from

Repository.minimum

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:233


preload

preload(entityLike): Promise<StrategyInstance>

Creates a new entity from the given plain javascript object. If entity already exist in the database, then it loads it (and everything related to it), replaces all values with the new ones from the given object and returns this new entity. This new entity is actually a loaded from the db entity with all properties replaced from the new object.

Note that given entity-like object must have an entity id / primary key to find entity by. Returns undefined if entity with given id was not found.

Parameters

NameType
entityLikeDeepPartial<StrategyInstance>

Returns

Promise<StrategyInstance>

Inherited from

Repository.preload

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:82


query

query(query, parameters?): Promise<any>

Executes a raw SQL query and returns a raw database results. Raw query execution is supported only by relational databases (MongoDB is not supported).

Parameters

NameType
querystring
parameters?any[]

Returns

Promise<any>

Inherited from

Repository.query

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:304


recover

recover<T>(entities, options): Promise<T[]>

Recovers all given entities in the database.

Type parameters

NameType
Textends DeepPartial<StrategyInstance>

Parameters

NameType
entitiesT[]
optionsSaveOptions & { reload: false }

Returns

Promise<T[]>

Inherited from

Repository.recover

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:138

recover<T>(entities, options?): Promise<T & StrategyInstance[]>

Recovers all given entities in the database.

Type parameters

NameType
Textends DeepPartial<StrategyInstance>

Parameters

NameType
entitiesT[]
options?SaveOptions

Returns

Promise<T & StrategyInstance[]>

Inherited from

Repository.recover

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:144

recover<T>(entity, options): Promise<T>

Recovers a given entity in the database.

Type parameters

NameType
Textends DeepPartial<StrategyInstance>

Parameters

NameType
entityT
optionsSaveOptions & { reload: false }

Returns

Promise<T>

Inherited from

Repository.recover

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:148

recover<T>(entity, options?): Promise<T & StrategyInstance>

Recovers a given entity in the database.

Type parameters

NameType
Textends DeepPartial<StrategyInstance>

Parameters

NameType
entityT
options?SaveOptions

Returns

Promise<T & StrategyInstance>

Inherited from

Repository.recover

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:154


remove

remove(entities, options?): Promise<StrategyInstance[]>

Removes a given entities from the database.

Parameters

NameType
entitiesStrategyInstance[]
options?RemoveOptions

Returns

Promise<StrategyInstance[]>

Inherited from

Repository.remove

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:110

remove(entity, options?): Promise<StrategyInstance>

Removes a given entity from the database.

Parameters

NameType
entityStrategyInstance
options?RemoveOptions

Returns

Promise<StrategyInstance>

Inherited from

Repository.remove

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:114


restore

restore(criteria): Promise<UpdateResult>

Restores entities by a given criteria. Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient SOFT-DELETE query. Does not check if entity exist in the database.

Parameters

NameType
criteriastring | number | string[] | number[] | Date | FindOptionsWhere<StrategyInstance> | ObjectId | Date[] | ObjectId[]

Returns

Promise<UpdateResult>

Inherited from

Repository.restore

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:195


save

save<T>(entities, options): Promise<T[]>

Saves all given entities in the database. If entities do not exist in the database then inserts, otherwise updates.

Type parameters

NameType
Textends DeepPartial<StrategyInstance>

Parameters

NameType
entitiesT[]
optionsSaveOptions & { reload: false }

Returns

Promise<T[]>

Inherited from

Repository.save

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:87

save<T>(entities, options?): Promise<T & StrategyInstance[]>

Saves all given entities in the database. If entities do not exist in the database then inserts, otherwise updates.

Type parameters

NameType
Textends DeepPartial<StrategyInstance>

Parameters

NameType
entitiesT[]
options?SaveOptions

Returns

Promise<T & StrategyInstance[]>

Inherited from

Repository.save

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:94

save<T>(entity, options): Promise<T>

Saves a given entity in the database. If entity does not exist in the database then inserts, otherwise updates.

Type parameters

NameType
Textends DeepPartial<StrategyInstance>

Parameters

NameType
entityT
optionsSaveOptions & { reload: false }

Returns

Promise<T>

Inherited from

Repository.save

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:99

save<T>(entity, options?): Promise<T & StrategyInstance>

Saves a given entity in the database. If entity does not exist in the database then inserts, otherwise updates.

Type parameters

NameType
Textends DeepPartial<StrategyInstance>

Parameters

NameType
entityT
options?SaveOptions

Returns

Promise<T & StrategyInstance>

Inherited from

Repository.save

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:106


softDelete

softDelete(criteria): Promise<UpdateResult>

Records the delete date of entities by a given criteria. Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient SOFT-DELETE query. Does not check if entity exist in the database.

Parameters

NameType
criteriastring | number | string[] | number[] | Date | FindOptionsWhere<StrategyInstance> | ObjectId | Date[] | ObjectId[]

Returns

Promise<UpdateResult>

Inherited from

Repository.softDelete

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:188


softRemove

softRemove<T>(entities, options): Promise<T[]>

Records the delete date of all given entities.

Type parameters

NameType
Textends DeepPartial<StrategyInstance>

Parameters

NameType
entitiesT[]
optionsSaveOptions & { reload: false }

Returns

Promise<T[]>

Inherited from

Repository.softRemove

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:118

softRemove<T>(entities, options?): Promise<T & StrategyInstance[]>

Records the delete date of all given entities.

Type parameters

NameType
Textends DeepPartial<StrategyInstance>

Parameters

NameType
entitiesT[]
options?SaveOptions

Returns

Promise<T & StrategyInstance[]>

Inherited from

Repository.softRemove

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:124

softRemove<T>(entity, options): Promise<T>

Records the delete date of a given entity.

Type parameters

NameType
Textends DeepPartial<StrategyInstance>

Parameters

NameType
entityT
optionsSaveOptions & { reload: false }

Returns

Promise<T>

Inherited from

Repository.softRemove

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:128

softRemove<T>(entity, options?): Promise<T & StrategyInstance>

Records the delete date of a given entity.

Type parameters

NameType
Textends DeepPartial<StrategyInstance>

Parameters

NameType
entityT
options?SaveOptions

Returns

Promise<T & StrategyInstance>

Inherited from

Repository.softRemove

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:134


sum

sum(columnName, where?): Promise<number>

Return the SUM of a column

Parameters

NameType
columnNamenever
where?FindOptionsWhere<StrategyInstance> | FindOptionsWhere<StrategyInstance>[]

Returns

Promise<number>

Inherited from

Repository.sum

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:225


update

update(criteria, partialEntity): Promise<UpdateResult>

Updates entity partially. Entity can be found by a given conditions. Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient UPDATE query. Does not check if entity exist in the database.

Parameters

NameType
criteriastring | number | string[] | number[] | Date | FindOptionsWhere<StrategyInstance> | ObjectId | Date[] | ObjectId[]
partialEntity_QueryDeepPartialEntity<StrategyInstance>

Returns

Promise<UpdateResult>

Inherited from

Repository.update

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:168


upsert

upsert(entityOrEntities, conflictPathsOrOptions): Promise<InsertResult>

Inserts a given entity into the database, unless a unique constraint conflicts then updates the entity Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient INSERT ... ON CONFLICT DO UPDATE/ON DUPLICATE KEY UPDATE query.

Parameters

NameType
entityOrEntities_QueryDeepPartialEntity<StrategyInstance> | _QueryDeepPartialEntity<StrategyInstance>[]
conflictPathsOrOptionsstring[] | UpsertOptions<StrategyInstance>

Returns

Promise<InsertResult>

Inherited from

Repository.upsert

Defined in

gropius-login-service/backend/node_modules/typeorm/repository/Repository.d.ts:174