### Hierarchy

- DataRequestManager

### Implemented by

- DataRequestManagerImpl

## Index

### Methods

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

## Methods

### decryptMessage

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

- - Defined in manager/DataRequestManager.ts:87

  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<object | string>

  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 authorized 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 authorized to access

  #### Parameters

  - ##### clientPk: string

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

  #### 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 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

  #### Parameters

  - ##### whoRequestedPk: string

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

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

  Array of field names that were requested for access

### getRequests

- getRequests(fromPk: string | null, toPk: string | null): 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 | null

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

  - ##### toPk: string | null

    (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

    of price

  #### 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