diff --git a/src/contractIntegration/accessInteraction/AccessInteraction.ts b/src/contractIntegration/accessInteraction/AccessInteraction.ts index 0d6121c..d66c299 100644 --- a/src/contractIntegration/accessInteraction/AccessInteraction.ts +++ b/src/contractIntegration/accessInteraction/AccessInteraction.ts @@ -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} Return the trasaction address. + * @param {string} identity This parameter is the Identity to configure the smart contract interaction. + * @returns {Promise} Returns the transaction address. */ async giveAccess(resource: string, consentId: string, accounts: string[], resourceName: string, identity: IdentityManager): Promise { if (resource.trim() === '' || resource.trim().length === 0) throw new Error('The resource must have at least one character'); @@ -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} 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} Returns whether the user has access in this consent. */ async checkAccess(resource: string, consentId: string, identity: IdentityManager): Promise { if (resource.trim() === '' || resource.trim().length === 0) throw new Error('The resource must have at least one character'); @@ -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} 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} Returns address and state of the user in this consent. */ async getResourceByConsent(consentId: string, identity: IdentityManager): Promise { if (consentId.trim() === '' || consentId.trim().length === 0) throw new Error('The consentID must have at least one character'); diff --git a/src/contractIntegration/consentInteraction/ConsentInteraction.ts b/src/contractIntegration/consentInteraction/ConsentInteraction.ts index 1eecd55..af18028 100644 --- a/src/contractIntegration/consentInteraction/ConsentInteraction.ts +++ b/src/contractIntegration/consentInteraction/ConsentInteraction.ts @@ -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() @@ -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} return the address of the transaction. */ async saveConsent(consentId: string, identity: IdentityManager): Promise { @@ -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} return the address of the transaction. */ async cancelConsent(consentId: string, identity: IdentityManager): Promise { @@ -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} return the consent status. */ async getConsentById(consentId: string, owner: string, identity: IdentityManager): Promise { @@ -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} return the address of the transaction. */ async addKey(consentId: string, addressConsent: string, key: string, identity: IdentityManager): Promise { @@ -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} 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} return the addresses and keys */ async getKeys(consentId: string, identity: IdentityManager): Promise { if (consentId.trim() === '' || consentId.trim().length === 0) throw new Error('contentID must have at least 1 character'); diff --git a/src/contractIntegration/interaction/FactoryInteraction.ts b/src/contractIntegration/interaction/FactoryInteraction.ts index 53cd396..ebf36fa 100644 --- a/src/contractIntegration/interaction/FactoryInteraction.ts +++ b/src/contractIntegration/interaction/FactoryInteraction.ts @@ -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 { diff --git a/src/documentSharing/DocumentSharing.ts b/src/documentSharing/DocumentSharing.ts index e29e5ae..cc5f43f 100644 --- a/src/documentSharing/DocumentSharing.ts +++ b/src/documentSharing/DocumentSharing.ts @@ -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 { diff --git a/src/encryptionLayer/EncryptionLayerAES.ts b/src/encryptionLayer/EncryptionLayerAES.ts index 1bd424b..7192a98 100644 --- a/src/encryptionLayer/EncryptionLayerAES.ts +++ b/src/encryptionLayer/EncryptionLayerAES.ts @@ -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<string>, when resolved it returns a string representing the encrypted data. */ encryptData(key: string, data: string): Promise { @@ -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. diff --git a/src/factoryIdentity/FactoryIdentity.ts b/src/factoryIdentity/FactoryIdentity.ts index 5c18630..e2d6951 100644 --- a/src/factoryIdentity/FactoryIdentity.ts +++ b/src/factoryIdentity/FactoryIdentity.ts @@ -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. diff --git a/src/indentityManager/IdentityManager.ts b/src/indentityManager/IdentityManager.ts index 0b21713..be9f720 100644 --- a/src/indentityManager/IdentityManager.ts +++ b/src/indentityManager/IdentityManager.ts @@ -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, @@ -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 => { if (this.mnemonic.trim() === '' && this.address.trim() === '' && diff --git a/src/storageEngine/IPFSEngine.ts b/src/storageEngine/IPFSEngine.ts index b566391..b66845b 100644 --- a/src/storageEngine/IPFSEngine.ts +++ b/src/storageEngine/IPFSEngine.ts @@ -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 {