Skip to content

@sourceloop/core / Exports / ITenantGuard

Interface: ITenantGuard<T, ID>

Type parameters

Name Type
T extends Entity
ID ID

Implemented by

Table of contents

Methods

Methods

count

count(where?): Promise<Where<T>>

Parameters

Name Type
where? Where<T>

Returns

Promise<Where<T>>

Defined in

packages/core/src/components/tenant-utilities/types.ts:58


create

create(data): Promise<DataObject<T>>

Parameters

Name Type
data DataObject<T>

Returns

Promise<DataObject<T>>

Defined in

packages/core/src/components/tenant-utilities/types.ts:60


createAll

createAll(data): Promise<DataObject<T>[]>

Parameters

Name Type
data DataObject<T>[]

Returns

Promise<DataObject<T>[]>

Defined in

packages/core/src/components/tenant-utilities/types.ts:61


delete

delete(entity): Promise<{ entity: T ; where: Where<T> }>

Parameters

Name Type
entity T

Returns

Promise<{ entity: T ; where: Where<T> }>

Defined in

packages/core/src/components/tenant-utilities/types.ts:88


deleteAll

deleteAll(where?): Promise<Where<T>>

Parameters

Name Type
where? Where<T>

Returns

Promise<Where<T>>

Defined in

packages/core/src/components/tenant-utilities/types.ts:92


deleteById

deleteById(id): Promise<Where<T>>

Parameters

Name Type
id ID

Returns

Promise<Where<T>>

Defined in

packages/core/src/components/tenant-utilities/types.ts:93


exists

exists(id): Promise<Where<T>>

Parameters

Name Type
id ID

Returns

Promise<Where<T>>

Defined in

packages/core/src/components/tenant-utilities/types.ts:59


find

find(filter?): Promise<Filter<T>>

Parameters

Name Type
filter? Filter<T>

Returns

Promise<Filter<T>>

Defined in

packages/core/src/components/tenant-utilities/types.ts:55


findById

findById(id, filter?): Promise<Filter<T>>

Parameters

Name Type
id ID
filter? FilterExcludingWhere<T>

Returns

Promise<Filter<T>>

Defined in

packages/core/src/components/tenant-utilities/types.ts:56


findOne

findOne(filter?): Promise<Filter<T>>

Parameters

Name Type
filter? Filter<T>

Returns

Promise<Filter<T>>

Defined in

packages/core/src/components/tenant-utilities/types.ts:57


replaceById

replaceById(id, data): Promise<{ data: DataObject<T> ; where: Where<T> }>

Parameters

Name Type
id ID
data DataObject<T>

Returns

Promise<{ data: DataObject<T> ; where: Where<T> }>

Defined in

packages/core/src/components/tenant-utilities/types.ts:81


save

save(entity): Promise<T>

Parameters

Name Type
entity T

Returns

Promise<T>

Defined in

packages/core/src/components/tenant-utilities/types.ts:62


skipTenantGuard

skipTenantGuard(): Promise<boolean>

Returns

Promise<boolean>

Defined in

packages/core/src/components/tenant-utilities/types.ts:94


update

update(data): Promise<{ data: T ; where: Where<T> }>

Parameters

Name Type
data T

Returns

Promise<{ data: T ; where: Where<T> }>

Defined in

packages/core/src/components/tenant-utilities/types.ts:63


updateAll

updateAll(data, where?): Promise<{ data: DataObject<T> ; where: Where<T> }>

Parameters

Name Type
data DataObject<T>
where? Where<T>

Returns

Promise<{ data: DataObject<T> ; where: Where<T> }>

Defined in

packages/core/src/components/tenant-utilities/types.ts:67


updateById

updateById(id, data): Promise<{ data: DataObject<T> ; where: Where<T> }>

Parameters

Name Type
id ID
data DataObject<T>

Returns

Promise<{ data: DataObject<T> ; where: Where<T> }>

Defined in

packages/core/src/components/tenant-utilities/types.ts:74