LinkSecretRepository
@hyperledger/identus-sdk v7.0.0
@hyperledger/identus-sdk / overview / LinkSecretRepository
Class: LinkSecretRepository
Defined in: src/pluto/repositories/LinkSecretRepository.ts:6
MapperRepository
Extends BaseRepository to handle Store interactions while mapping between a Domain class and a Model object
Extends
Constructors
Constructor
new LinkSecretRepository(
store:Store):LinkSecretRepository
Defined in: src/pluto/repositories/LinkSecretRepository.ts:11
Parameters
| Parameter | Type | 
|---|---|
| store | Store | 
Returns
LinkSecretRepository
Overrides
Properties
| Property | Type | Description | Overrides | Defined in | 
|---|---|---|---|---|
| baseModel | { recoveryId:string; } | Allows setting of properties to be present in all Models sent to Store | MapperRepository.baseModel | src/pluto/repositories/LinkSecretRepository.ts:7 | 
| baseModel.recoveryId | string | - | - | src/pluto/repositories/LinkSecretRepository.ts:8 | 
Methods
byUUID()
byUUID(
uuid:string):Promise<LinkSecret|null>
Defined in: src/pluto/repositories/builders/MapperRepository.ts:75
Utility fn for common use of find with uuid
Parameters
| Parameter | Type | Description | 
|---|---|---|
| uuid | string | 
Returns
Promise<LinkSecret | null>
first found Domain instance or undefined
Throws
Domain.PlutoError.StoreQueryFailed if the query fails
Inherited from
delete()
delete(
uuid:string):Promise<void>
Defined in: src/pluto/repositories/builders/BaseRepository.ts:52
Parameters
| Parameter | Type | 
|---|---|
| uuid | string | 
Returns
Promise<void>
Inherited from
find()
find(
selector?:Partial<Key>):Promise<LinkSecret[]>
Defined in: src/pluto/repositories/builders/MapperRepository.ts:48
Search for instances based on given values
Parameters
| Parameter | Type | Description | 
|---|---|---|
| selector? | Partial<Key> | object with matchable properties | 
Returns
Promise<LinkSecret[]>
all found Domain instances
Throws
Domain.PlutoError.StoreQueryFailed if the query fails
Inherited from
findOne()
findOne(
selector?:Partial<Key>):Promise<LinkSecret|null>
Defined in: src/pluto/repositories/builders/MapperRepository.ts:61
Search for single instance based on given values
Parameters
| Parameter | Type | Description | 
|---|---|---|
| selector? | Partial<Key> | object with matchable properties | 
Returns
Promise<LinkSecret | null>
first found Domain instance or null
Throws
Domain.PlutoError.StoreQueryFailed if the query fails
Inherited from
get()
get(
query?:Query<Key>):Promise<LinkSecret[]>
Defined in: src/pluto/repositories/builders/MapperRepository.ts:36
Search the Store, mapping any found to Domain
Parameters
| Parameter | Type | Description | 
|---|---|---|
| query? | Query<Key> | either an object or array of objects with matchable properties | 
Returns
Promise<LinkSecret[]>
Array of matched Domain instances
Throws
Domain.PlutoError.StoreQueryFailed if the query fails
Inherited from
getModels()
Defined in: src/pluto/repositories/builders/BaseRepository.ts:86
Search the Store for Models
Parameters
| Parameter | Type | Description | 
|---|---|---|
| query? | Query<Key> | a Query object, a set of values and operators defining the query | 
Returns
Promise<Key[]>
Array of matched Models
See
../types.ts
Examples
search for a model with uuid and name
  repo.getModels({ selector: { uuid: "1", name: "eg" }})
search for models with uuid of 1 or 2
  repo.getModels({ selector: { $or: [{ uuid: "1" }, { uuid: "2" }] }})
search for all models
  repo.getModels()
Throws
Domain.Models if the query fails
Inherited from
insert()
Defined in: src/pluto/repositories/builders/BaseRepository.ts:32
Persist the Model in the Store.
Parameters
| Parameter | Type | Description | 
|---|---|---|
| model | Key | 
Returns
Promise<Key>
Throws
Domain.PlutoError.StoreInsertError if insert fails
Inherited from
save()
save(
domain:LinkSecret):Promise<void>
Defined in: src/pluto/repositories/builders/MapperRepository.ts:89
Persist the Domain instance in the Store.
Parameters
| Parameter | Type | Description | 
|---|---|---|
| domain | LinkSecret | Will be mapped to relevant Model for persistance | 
Returns
Promise<void>
See
Throws
Domain.PlutoError.StoreInsertError if insert fails
Inherited from
toDomain()
toDomain(
model:Key):LinkSecret
Defined in: src/pluto/repositories/LinkSecretRepository.ts:15
Map from a Model to the Domain class
Parameters
| Parameter | Type | Description | 
|---|---|---|
| model | Key | the stored Model with a uuid | 
Returns
Domain with uuid set
Overrides
toModel()
toModel(
domain:LinkSecret):Key
Defined in: src/pluto/repositories/LinkSecretRepository.ts:22
Map from a Domain class to a Model
Parameters
| Parameter | Type | Description | 
|---|---|---|
| domain | LinkSecret | may be missing uuid | 
Returns
Model potentially without uuid
Overrides
update()
update(
model:Key):Promise<void>
Defined in: src/pluto/repositories/builders/BaseRepository.ts:43
Parameters
| Parameter | Type | 
|---|---|
| model | Key | 
Returns
Promise<void>