### Hierarchy

- DataRequestManagerImpl

### Implements

- DataRequestManager

## Index

### Constructors

- constructor

### Methods

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

## Constructors

### constructor

- new DataRequestManagerImpl(dataRequestRepository: DataRequestRepository, authAccountBehavior: Observable<Account>, encrypt: MessageEncrypt, decrypt: MessageDecrypt): DataRequestManagerImpl

- - Defined in manager/DataRequestManagerImpl.ts:22

  #### Parameters

  - ##### dataRequestRepository: DataRequestRepository

  - ##### authAccountBehavior: Observable<Account>

  - ##### encrypt: MessageEncrypt

  - ##### decrypt: MessageDecrypt

  #### Returns DataRequestManagerImpl

## Methods

### decryptMessage

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

- Implementation of DataRequestManager.decryptMessage

  - Defined in manager/DataRequestManagerImpl.ts:221

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

- Implementation of DataRequestManager.getGrantedPermissions

  - Defined in manager/DataRequestManagerImpl.ts:165

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

- Implementation of DataRequestManager.getGrantedPermissionsToMe

  - Defined in manager/DataRequestManagerImpl.ts:177
  deprecated

    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 | undefined): Promise<Array<FieldData>>

- Implementation of DataRequestManager.getRequestedPermissions

  - Defined in manager/DataRequestManagerImpl.ts:141

  Returns list of fields requested for access by from the client

  #### Parameters

  - ##### Optional requestedFromPk: string | undefined

    id (baseID) of the client whose permissions were requested. is optional.

  #### Returns Promise<Array<FieldData>>

  Array of field names that were requested for access

### getRequestedPermissionsToMe

- getRequestedPermissionsToMe(whoRequestedPk?: string | undefined): Promise<Array<FieldData>>

- Implementation of DataRequestManager.getRequestedPermissionsToMe

  - Defined in manager/DataRequestManagerImpl.ts:153

  Returns list of fields requested for access by the client from

  #### Parameters

  - ##### Optional whoRequestedPk: string | undefined

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

  #### Returns Promise<Array<FieldData>>

  Array of field names that were requested for access

### getRequests

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

- Implementation of DataRequestManager.getRequests

  - Defined in manager/DataRequestManagerImpl.ts:64

  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

### getRequestsGraph

- getRequestsGraph(data: InputGraphData): Promise<OutputGraphData>

- Implementation of DataRequestManager.getRequestsGraph

  - Defined in manager/DataRequestManagerImpl.ts:38

  #### Parameters

  - ##### data: InputGraphData

  #### Returns Promise<OutputGraphData>

### grantAccessForClient

- grantAccessForClient(clientPk: string, acceptedFields: Map<string, AccessRight>, rootPk?: string): Promise<void>

- Implementation of DataRequestManager.grantAccessForClient

  - Defined in manager/DataRequestManagerImpl.ts:77

  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>

  - ##### Optional rootPk: string

    ID (baseID) of the client that is the data owner.

  #### Returns Promise<void>

### grantAccessForOffer

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

- Implementation of DataRequestManager.grantAccessForOffer

  - Defined in manager/DataRequestManagerImpl.ts:191

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

- Implementation of DataRequestManager.requestPermissions

  - Defined in manager/DataRequestManagerImpl.ts:50

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

### revokeAccessForClient

- revokeAccessForClient(clientPk: string, revokeFields: Array<string>): Promise<void>

- Implementation of DataRequestManager.revokeAccessForClient

  - Defined in manager/DataRequestManagerImpl.ts:123

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

  #### Parameters

  - ##### clientPk: string

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

  - ##### revokeFields: Array<string>

  #### Returns Promise<void>

Generated using TypeDoc