LinkSecretRepository
@hyperledger/identus-sdk v8.0.0
@hyperledger/identus-sdk / overview / LinkSecretRepository
Class: LinkSecretRepository
Defined in: packages/lib/sdk/src/pluto/repositories/LinkSecretRepository.ts:7
MapperRepository
Extends BaseRepository to handle Store interactions while mapping between a Domain class and a Model object
Extends
MapperRepository<"keys",LinkSecret>
Constructors
Constructor
new LinkSecretRepository(
store:Store):LinkSecretRepository
Defined in: packages/lib/sdk/src/pluto/repositories/LinkSecretRepository.ts:12
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 | packages/lib/sdk/src/pluto/repositories/LinkSecretRepository.ts:8 |
baseModel.recoveryId | string | - | - | packages/lib/sdk/src/pluto/repositories/LinkSecretRepository.ts:9 |
Methods
byUUID()
byUUID(
uuid:string):Promise<LinkSecret|null>
Defined in: packages/lib/sdk/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: packages/lib/sdk/src/pluto/repositories/builders/BaseRepository.ts:53
Parameters
| Parameter | Type |
|---|---|
uuid | string |
Returns
Promise<void>
Inherited from
find()
find(
selector?:Partial<Key>):Promise<LinkSecret[]>
Defined in: packages/lib/sdk/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: packages/lib/sdk/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<TypedSchema<Key>>):Promise<LinkSecret[]>
Defined in: packages/lib/sdk/src/pluto/repositories/builders/MapperRepository.ts:36
Search the Store, mapping any found to Domain
Parameters
| Parameter | Type | Description |
|---|---|---|
query? | Query<TypedSchema<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()
getModels(
query?:Query<TypedSchema<Key>>):Promise<Key[]>
Defined in: packages/lib/sdk/src/pluto/repositories/builders/BaseRepository.ts:87
Search the Store for Models
Parameters
| Parameter | Type | Description |
|---|---|---|
query? | Query<TypedSchema<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: packages/lib/sdk/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: packages/lib/sdk/src/pluto/repositories/builders/MapperRepository.ts:88
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: packages/lib/sdk/src/pluto/repositories/LinkSecretRepository.ts:16
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: packages/lib/sdk/src/pluto/repositories/LinkSecretRepository.ts:23
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: packages/lib/sdk/src/pluto/repositories/builders/BaseRepository.ts:44
Parameters
| Parameter | Type |
|---|---|
model | Key |
Returns
Promise<void>