### Hierarchy

- DataRequestManager

### Implemented by

- DataRequestManagerImpl

## Index

### Methods

- decryptMessage
- getGrantedPermissions
- getGrantedPermissionsToMe
- getRequestedPermissions
- getRequestedPermissionsToMe
- getRequests
- grantAccessForClient
- grantAccessForOffer
- requestPermissions

## Methods

### decryptMessage

- decryptMessage(senderPk: string, encrypted: string): Promise<any>

- - Defined in manager/DataRequestManager.ts:82

  Decodes a message that was encrypted by the owner of the private key that matches the provided public key.

  #### Parameters

  - ##### senderPk: string

    public key of the user that issued data access request.

  - ##### encrypted: string

    encrypted data from {@link DataRequest#requestData} (ECIES).

  #### Returns Promise<any>

  object with data or null if was error.

### getGrantedPermissions

- getGrantedPermissions(clientPk: string): Promise<Array<string>>

- - Defined in manager/DataRequestManager.ts:54

  Returns list of fields that <client> authorized <me> to access

  #### Parameters

  - ##### clientPk: string

    id (baseID) of the client that granted me permission.

  #### Returns Promise<Array<string>>

  Array of field names that were authorized for access

### getGrantedPermissionsToMe

- getGrantedPermissionsToMe(clientPk: string): Promise<Array<string>>

- - Defined in manager/DataRequestManager.ts:61

  Returns list of fields that <me> authorized <client> to access

  #### Parameters

  - ##### clientPk: string

    id (baseID) of the client that received access permission from <me>

  #### Returns Promise<Array<string>>

  Array of field names that were authorized for access

### getRequestedPermissions

- getRequestedPermissions(requestedFromPk: string): Promise<Array<string>>

- - Defined in manager/DataRequestManager.ts:40

  Returns list of fields requested for access by <me> from the client

  #### Parameters

  - ##### requestedFromPk: string

    id (baseID) of the client whose permissions were requested

  #### Returns Promise<Array<string>>

  Array of field names that were requested for access

### getRequestedPermissionsToMe

- getRequestedPermissionsToMe(whoRequestedPk: string): Promise<Array<string>>

- - Defined in manager/DataRequestManager.ts:47

  Returns list of fields requested for access by the client from <me>

  #### Parameters

  - ##### whoRequestedPk: string

    id (baseID) of the client that asked for permission from <me>

  #### Returns Promise<Array<string>>

  Array of field names that were requested for access

### getRequests

- getRequests(fromPk: string, toPk: string): Promise<Array<DataRequest>>

- - Defined in manager/DataRequestManager.ts:23

  Returns a list of outstanding data access requests, where data access requests meet the provided search criteria.

  #### Parameters

  - ##### fromPk: string

    (Optional if toPk exist.) public key of the user that issued data access request.

  - ##### toPk: string

    (Optional if fromPk exist.) public key of the user that is expected to.

  #### Returns Promise<Array<DataRequest>>

  List of DataRequest, or empty list

### grantAccessForClient

- grantAccessForClient(clientPk: string, acceptedFields: Map<string, AccessRight>): Promise<number>

- - Defined in manager/DataRequestManager.ts:33

  Grants access to specific fields of my data to a client.

  #### Parameters

  - ##### clientPk: string

    id (baseID) of the client that is authorized for data access.

  - ##### acceptedFields: Map<string, AccessRight>

  #### Returns Promise<number>

### grantAccessForOffer

- grantAccessForOffer(offerSearchId: number, offerOwner: string, acceptedFields: Map<string, AccessRight>, priceId: number): Promise<void>

- - Defined in manager/DataRequestManager.ts:73

  Grant access for offer.

  #### Parameters

  - ##### offerSearchId: number

    id of item search result OfferSearch and OfferSearchResultItem.

  - ##### offerOwner: string

    Public key of offer owner.

  - ##### acceptedFields: Map<string, AccessRight>

  - ##### priceId: number

  #### Returns Promise<void>

### requestPermissions

- requestPermissions(recipientPk: string, fields: Array<string>): Promise<number>

- - Defined in manager/DataRequestManager.ts:14

  Creates data access request to a specific user for a specific personal data.

  #### Parameters

  - ##### recipientPk: string

    Public Key of the user that the personal data is requested from.

  - ##### fields: Array<string>

    Array of name identifiers for the requested data fields (e.g. this is keys in {Map<string, string>}).

  #### Returns Promise<number>

  Returns requestID upon successful request record creation.

Generated using TypeDoc