Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/contractIntegration/accessInteraction/AccessInteraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class AccessInteraction implements IAccessInteraction {
* @param {string} consentId This parameter is the id of the consent.
* @param {string} accounts This parameter is the accounts to give access.
* @param {string} resourceName This parameter is the resource name.
* @param {string} identity This parameter is the Identity to configurate the smart contract interaction.
* @returns {Promise<string>} Return the trasaction address.
* @param {string} identity This parameter is the Identity to configure the smart contract interaction.
* @returns {Promise<string>} Returns the transaction address.
*/
async giveAccess(resource: string, consentId: string, accounts: string[], resourceName: string, identity: IdentityManager): Promise<boolean> {
if (resource.trim() === '' || resource.trim().length === 0) throw new Error('The resource must have at least one character');
Expand All @@ -45,12 +45,12 @@ class AccessInteraction implements IAccessInteraction {
}

/**
* This function check the access in the resource using the consent id and the user address.
* This function checks the access in the resource using the consent id and the user address.
*
* @param {string} resource This parameter is the resource to be checked.
* @param {string} consentId This parameter is the id of the consent to be checked.
* @param {IdentityManager} identity This parameter is the Identity to configurate the smart contract interaction.
* @returns {Promise<boolean>} Return if the user has access in this consent.
* @param {IdentityManager} identity This parameter is the Identity to configure the smart contract interaction.
* @returns {Promise<boolean>} Returns whether the user has access in this consent.
*/
async checkAccess(resource: string, consentId: string, identity: IdentityManager): Promise<boolean> {
if (resource.trim() === '' || resource.trim().length === 0) throw new Error('The resource must have at least one character');
Expand All @@ -64,11 +64,11 @@ class AccessInteraction implements IAccessInteraction {
}

/**
* This function check the resource and it's state.
* This function checks the resource and its state.
*
* @param {string} consentId This parameter is the resource to be returned.
* @param {IdentityManager} identity This parameter is the Identity to configurate the smart contract interaction.
* @returns {Promise<IAccessResource>} Return addres and state of the user in this consent.
* @param {string} consentId This parameter is the consent ID to be checked.
* @param {IdentityManager} identity This parameter is the Identity to configure the smart contract interaction.
* @returns {Promise<IAccessResource>} Returns address and state of the user in this consent.
*/
async getResourceByConsent(consentId: string, identity: IdentityManager): Promise<IAccessResource> {
if (consentId.trim() === '' || consentId.trim().length === 0) throw new Error('The consentID must have at least one character');
Expand Down
34 changes: 17 additions & 17 deletions src/contractIntegration/consentInteraction/ConsentInteraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import IContractActions from '../interaction/web3Provider/IContractActions';


/**
* This class represent the implementation of IConsentInteraction interface,
* This class represents the implementation of IConsentInteraction interface,
* this class is used to interact with the consent smart contract.
*/
@injectable()
Expand All @@ -21,7 +21,7 @@ class ConsentInteraction implements IConsentInteraction {
* This function saves a consent with the information passed as parameters.
*
* @param {string} consentId This parameter is the consentID to identify consent.
* @param {IdentityManager} identity This parameter is the Identity to configurate the smart contract interaction.
* @param {IdentityManager} identity This parameter is the Identity to configure the smart contract interaction.
* @returns {Promise<string>} return the address of the transaction.
*/
async saveConsent(consentId: string, identity: IdentityManager): Promise<boolean> {
Expand All @@ -36,10 +36,10 @@ class ConsentInteraction implements IConsentInteraction {
}

/**
* This function cancel a consent based in the consentID passed in the parameter.
* This function cancels a consent based in the consentID passed in the parameter.
*
* @param {string} consentId This parameter is the consentID to identify consent.
* @param {IdentityManager} identity This parameter is the Identity to configurate the smart contract interaction.
* @param {IdentityManager} identity This parameter is the Identity to configure the smart contract interaction.
* @returns {Promise<string>} return the address of the transaction.
*/
async cancelConsent(consentId: string, identity: IdentityManager): Promise<boolean> {
Expand All @@ -54,11 +54,11 @@ class ConsentInteraction implements IConsentInteraction {
}

/**
* This function return the consent status based in the consentID passed in the parameter.
* This function returns the consent status based in the consentID passed in the parameter.
*
* @param {string} consentId This parameters is the consentID to indentify the consent.
* @param {string} owner This parameter is the owner addres.
* @param {IdentityManager} identity This parameter is the Identity to configurate the smart contract interaction.
* @param {string} consentId This parameter is the consentID to identify the consent.
* @param {string} owner This parameter is the owner address.
* @param {IdentityManager} identity This parameter is the Identity to configure the smart contract interaction.
* @returns {Promise<boolean>} return the consent status.
*/
async getConsentById(consentId: string, owner: string, identity: IdentityManager): Promise<boolean> {
Expand All @@ -74,13 +74,13 @@ class ConsentInteraction implements IConsentInteraction {
}

/**
* This funtion add a key in a consent based in the consentID in the case if the consent
* has already been acepted.
* This function add a key in a consent based in the consentID in the case if the consent
* has already been accepted.
*
* @param {string} consentId This parameter is the consentID to indentify the consent.
* @param {string} addressConsent This parameter is the adressConsent to indentify the consent.
* @param {string} consentId This parameter is the consentID to identify the consent.
* @param {string} addressConsent This parameter is the addressConsent to identify the consent.
* @param {string} key This parameter is the key to be added in the consent.
* @param {IdentityManager} identity This parameter is the Identity to configurate the smart contract interaction.
* @param {IdentityManager} identity This parameter is the Identity to configure the smart contract interaction.
* @returns {Promise<string>} return the address of the transaction.
*/
async addKey(consentId: string, addressConsent: string, key: string, identity: IdentityManager): Promise<boolean> {
Expand All @@ -98,11 +98,11 @@ class ConsentInteraction implements IConsentInteraction {
}

/**
* This funtion return the addres's and keys's the consent based in the consentId.
* This function return the addresses and keys the consent based in the consentId.
*
* @param {string} consentId This parameter is the consentID to indentify the consent.
* @param {IdentityManager} identity This parameter is the Identity to configurate the smart contract interaction.
* @returns {Promise<IConsentKeys>} return the addres's and keys's
* @param {string} consentId This parameter is the consentID to identify the consent.
* @param {IdentityManager} identity This parameter is the Identity to configure the smart contract interaction.
* @returns {Promise<IConsentKeys>} return the addresses and keys
*/
async getKeys(consentId: string, identity: IdentityManager): Promise<IConsentKeys> {
if (consentId.trim() === '' || consentId.trim().length === 0) throw new Error('contentID must have at least 1 character');
Expand Down
6 changes: 3 additions & 3 deletions src/contractIntegration/interaction/FactoryInteraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ class FactoryInteraction {
}

/**
* This function generate a new instance of Interaction class using the implementations
* This function generates a new instance of Interaction class using the implementations
* passed in the parameter.
*
* @param {string} consentType This parameter is the option of consentInteraction implementation.
* @param {string} accessType This parameter is the option of accessInteraction Implementation.
* @param {string} IPFSManagementType This parameter is the option of IPFSManagementInteraction Implementation.
* @param {string} accessType This parameter is the option of accessInteraction implementation.
* @param {string} IPFSManagementType This parameter is the option of IPFSManagementInteraction implementation.
* @returns {Interaction} return a new instance of Interaction class.
*/
public generateInteraction(consentType: string, accessType: string, IPFSManagementType: string): Interaction {
Expand Down
2 changes: 1 addition & 1 deletion src/documentSharing/DocumentSharing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { IDocumentSharingSave } from './types/IDocumentSharingSave';
import { IDocumentSharingFile } from './types/IDocumentSharingFile';

/**
* Document sharing, allow save encrypted files and sharing them with another users.
* Document sharing, allows saving encrypted files and sharing them with other users.
*/
@injectable()
class DocumentSharing implements IDocumentSharing {
Expand Down
6 changes: 3 additions & 3 deletions src/encryptionLayer/EncryptionLayerAES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class EncryptionLayerAES implements IEncryptionLayer {

/**
* This function encrypts the data passed as a parameter
* using the key passed as a parameter with the AES-25 algorithm.
* using the key passed as a parameter with the AES-256 algorithm.
*
* @param {string} key This parameter is the key with which the information will be encrypted.
* @param {string} data This parameter is the information to be encrypted.
* @returns {string} returns a string promise, when resolved it returns a string representing the encrypted data.
* @returns {string} returns a Promise&lt;string&gt;, when resolved it returns a string representing the encrypted data.
*/
encryptData(key: string, data: string): Promise<string> {

Expand All @@ -40,7 +40,7 @@ class EncryptionLayerAES implements IEncryptionLayer {
return Promise.resolve(transitMessage);
}
/**
* This function decrypt the data passed as a parameter
* This function decrypts the data passed as a parameter
* using the key passed as a parameter.
*
* @param {string} key This parameter is the key which the information will be decrypted.
Expand Down
2 changes: 1 addition & 1 deletion src/factoryIdentity/FactoryIdentity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class FactoryIdentity {
}

/**
* This function generates a new identity with past implementations as parameters.
* This function generates a new identity with passed implementations as parameters.
*
* @param {string} encryptionLayerType This parameter is the option of EncryptionLayer implementation.
* @param {string} generatorKeysType This parameter is the option of KeysGenerator implementation.
Expand Down
4 changes: 2 additions & 2 deletions src/indentityManager/IdentityManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class IdentityManager {
* This constructor initializes the class instance with the values passed as parameters.
*
* @param {IEncryptionLayer} encryptionLayer this parameter is the EncryptionLayer implementation.
* @param {IKeysGenerator} keysGenerator this is parameter is the KeysGenerator implementation.
* @param {IKeysGenerator} keysGenerator this parameter is the KeysGenerator implementation.
*/
public constructor(
@inject('EncryptionLayer') encryptionLayer: IEncryptionLayer,
Expand All @@ -50,7 +50,7 @@ class IdentityManager {
* This function generates an identity based on the mnemonic passed as parameters, in case of not passing
* the mnemonic a new identity will be created based on a totally new mnemonic.
*
* @param {string} mnemonic This parameter is the 12 words that will be used to generate the identity information.
* @param {string} mnemonic This parameter are the 12 words that will be used to generate the identity information.
*/
public generateIdentity = async (mnemonic = ''): Promise<void> => {
if (this.mnemonic.trim() === '' && this.address.trim() === '' &&
Expand Down
2 changes: 1 addition & 1 deletion src/storageEngine/IPFSEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class IPFSEngine implements IStorageEngine {
* Save file in a specific storage engine
* @param {object} options - File to save and additional parameters
* @returns {string} returns the file identifier or location
* @throws {BadRequestError} File was not save on IPFS
* @throws {BadRequestError} File was not saved on IPFS
* @throws {InternalServerError} Internal server error
*/
async saveFile(options: object): Promise<string> {
Expand Down