diff --git a/src/Apostille.ts b/src/Apostille.ts index 675caee..f7446c7 100644 --- a/src/Apostille.ts +++ b/src/Apostille.ts @@ -42,14 +42,14 @@ export class Apostille { /** * Create an Apostille - * @param {string} filename Name of the file (with extension) - * @param {string} fileContent Content of the file (as Base64) - * @param {string} tags Tags for the file - * @param {string} description Description for the file - * @param {string} url Url for the file - * @param {string} privateKey Private key of owner - * @param {NetworkType} network Network type - * @return {Apostille} An Apostille + * @param {string} filename - Name of the file (with extension) + * @param {string} fileContent - Content of the file (as Base64) + * @param {string} tags - Tags for the file + * @param {string} description - Description for the file + * @param {string} url - Url for the file + * @param {string} privateKey - Private key of owner + * @param {NetworkType} network - Network type + * @return {Apostille} - An Apostille */ public static create(filename: string, fileContent: string, tags: string, description: string, url: string, privateKey: string, network: NetworkType): Apostille { const owner = Account.createFromPrivateKey(privateKey, network); @@ -61,8 +61,8 @@ export class Apostille { /** * Update an Apostille - * @param {Metadata[]} metadata Dedicated account's metadata - * @return {boolean} True if success, false otherwise + * @param {Metadata[]} metadata - Dedicated account's metadata + * @return {boolean} - True if success, false otherwise */ public update(metadata: Metadata[]): boolean { const m = ApostilleMetadata.create(metadata); diff --git a/src/ApostilleAccount.ts b/src/ApostilleAccount.ts index cdb8af4..7a83a14 100644 --- a/src/ApostilleAccount.ts +++ b/src/ApostilleAccount.ts @@ -22,10 +22,10 @@ export class ApostilleAccount { /** * Generate an Apostille account for a file. * Will always generate the same account for a given file name and owner private key - * @param {string} privateKey Private key of owner - * @param {string} filename File name (with extension) - * @param {NetworkType} network Network type - * @return {Account} Apostille Account + * @param {string} privateKey - Private key of owner + * @param {string} filename - File name (with extension) + * @param {NetworkType} network - Network type + * @return {Account} - Apostille Account */ public static create(privateKey: string, filename: string, network: NetworkType): Account { const owner = Account.createFromPrivateKey(privateKey, network); diff --git a/src/ApostilleHash.ts b/src/ApostilleHash.ts index 7bfc2b9..d7dcf0a 100644 --- a/src/ApostilleHash.ts +++ b/src/ApostilleHash.ts @@ -26,9 +26,9 @@ export class ApostilleHash { /** * Hash the file content and sign it - * @param {string} data File content (as Base64) - * @param {string} privateKey Private key of owner - * @param {NetworkType} network Network type + * @param {string} data - File content (as Base64) + * @param {string} privateKey - Private key of owner + * @param {NetworkType} network - Network type * @return {ApostilleHash} */ public static create(data: string, privateKey: string, network: NetworkType): ApostilleHash { @@ -39,8 +39,8 @@ export class ApostilleHash { /** * Hash the file content with SHA256 - * @param {string} data File content (Base64) - * @return {string} SHA256 hash of the file content + * @param {string} data - File content (Base64) + * @return {string} - SHA256 hash of the file content */ public static hash(data: string): string { const rawContent = CryptoJS.enc.Base64.parse(data); diff --git a/src/ApostilleHistory.ts b/src/ApostilleHistory.ts index ecbc9fc..1648823 100644 --- a/src/ApostilleHistory.ts +++ b/src/ApostilleHistory.ts @@ -23,9 +23,9 @@ export class ApostilleHistory { /** * Create an history account used for indexing Apostilles - * @param {string} privateKey Private key of owner - * @param {NetworkType} network Network type - * @return {Account} History Account + * @param {string} privateKey - Private key of owner + * @param {NetworkType} network - Network type + * @return {Account} - History Account */ public static create(privateKey: string, network: NetworkType): Account { const owner = Account.createFromPrivateKey(privateKey, network); @@ -38,9 +38,9 @@ export class ApostilleHistory { /** * Create a metadata transaction for recording history account address in owner's account metadata - * @param {PublicAccount} owner PublicAccount of owner - * @param {PublicAccount} history PublicAccount of history - * @param {NetworkType} network Network type + * @param {PublicAccount} owner - PublicAccount of owner + * @param {PublicAccount} history - PublicAccount of history + * @param {NetworkType} network - Network type * @return {InnerTransaction} */ public static metadataTransaction(owner: PublicAccount, history: PublicAccount, network: NetworkType): InnerTransaction { diff --git a/src/ApostilleMetadata.ts b/src/ApostilleMetadata.ts index cc673b3..22256c2 100644 --- a/src/ApostilleMetadata.ts +++ b/src/ApostilleMetadata.ts @@ -28,8 +28,8 @@ export class ApostilleMetadata { /** * Isolate Apostille related metadata from dedicated account's metadata - * @param {Metadata[]} metadata Dedicated account's metadata - * @return {ApostilleMetadata} Apostille metadata + * @param {Metadata[]} metadata - Dedicated account's metadata + * @return {ApostilleMetadata} - Apostille metadata */ public static create(metadata: Metadata[]): ApostilleMetadata { const name = ApostilleUtils.findMetadataByKey(metadata, metadataKey.name); diff --git a/src/ApostilleTransactions.ts b/src/ApostilleTransactions.ts index 60e5685..ca1f322 100644 --- a/src/ApostilleTransactions.ts +++ b/src/ApostilleTransactions.ts @@ -33,7 +33,7 @@ export class ApostilleTransactions { /** * Create base transactions for the Apostille - * @param {Apostille} apostille An Apostille + * @param {Apostille} apostille - An Apostille * @return {InnerTransaction[]} */ public static create(apostille: Apostille): InnerTransaction[] { @@ -50,10 +50,10 @@ export class ApostilleTransactions { /** * Create an AccountMetadataTransaction - * @param {Apostille} apostille An Apostille - * @param {string} metadataKey Metadata hex key - * @param {string} oldVal Old metadata value - * @param {string} newVal New metadata value + * @param {Apostille} apostille - An Apostille + * @param {string} metadataKey - Metadata hex key + * @param {string} oldVal - Old metadata value + * @param {string} newVal - New metadata value * @return {InnerTransaction} */ public static metadata(apostille: Apostille, metadataKey: string, oldVal: string, newVal: string): InnerTransaction { @@ -71,7 +71,7 @@ export class ApostilleTransactions { /** * Assign ownership of a dedicated account - * @param {Apostille} apostille An Apostille + * @param {Apostille} apostille - An Apostille * @return {InnerTransaction} */ public static ownership(apostille: Apostille): InnerTransaction { @@ -80,7 +80,7 @@ export class ApostilleTransactions { /** * Create a core transfer transaction - * @param {Apostille} apostille An Apostille + * @param {Apostille} apostille - An Apostille * @return {InnerTransaction} */ public static core(apostille: Apostille): InnerTransaction { @@ -94,7 +94,7 @@ export class ApostilleTransactions { /** * Create an history transfer transaction - * @param {Apostille} apostille An Apostille + * @param {Apostille} apostille - An Apostille * @return {InnerTransaction} */ public static history(apostille: Apostille): InnerTransaction { diff --git a/src/ApostilleUtils.ts b/src/ApostilleUtils.ts index 8b11763..866ae33 100644 --- a/src/ApostilleUtils.ts +++ b/src/ApostilleUtils.ts @@ -22,7 +22,7 @@ export class ApostilleUtils { /** * Create a short date as yyyy-mm-dd * @param {Date} date - * @return {string} Date as yyyy-mm-dd + * @return {string} - Date as yyyy-mm-dd */ public static toShortDate(date: Date): string { let dd: number | string = date.getDate(); @@ -35,8 +35,8 @@ export class ApostilleUtils { /** * Get the extension of a file - * @param {string} filename - * @return {string} File extension + * @param {string} filename - Name of the file + * @return {string} - File extension */ public static getExtension(filename: string): string { return "." + filename.split('.').slice(1).pop() || ""; @@ -44,8 +44,8 @@ export class ApostilleUtils { /** * Remove the extension of a file - * @param {string} filename - * @return {string} File name without extension + * @param {string} filename - Name of the file + * @return {string} - File name without extension */ public static removeExtension(filename: string): string { return filename.replace(/\.[^/.]+$/, ""); @@ -53,8 +53,8 @@ export class ApostilleUtils { /** * Extract all signers required from an array of Apostilles - * @param {Apostilles[]} apostilles Apostille array - * @return {Account[]} An array of signers Accounts + * @param {Apostilles[]} apostilles - Apostille array + * @return {Account[]} - An array of signers Accounts */ public static extractSigners(apostilles: Apostille[]): Account[] { let signers = []; @@ -69,8 +69,8 @@ export class ApostilleUtils { /** * Extract all transactions from an array of Apostilles - * @param {Apostilles[]} apostilles Apostille array - * @return {InnerTransaction[]} An array of inner transactions + * @param {Apostilles[]} apostilles - Apostille array + * @return {InnerTransaction[]} - An array of inner transactions */ public static extractTransactions(apostilles: Apostille[]): InnerTransaction[] { let txes = []; @@ -82,9 +82,9 @@ export class ApostilleUtils { /** * Return the MetadataEntry corresponding to a given key from an array of Metadata - * @param {Metadata[]} metadata Metadata array - * @param {string} key Metadata key - * @return {MetadataEntry} MetadataEntry or undefined + * @param {Metadata[]} metadata - Metadata array + * @param {string} key - Metadata key + * @return {MetadataEntry} - MetadataEntry or undefined */ public static findMetadataByKey(metadata: Metadata[], key: string): MetadataEntry { const meta = metadata.find(meta => meta.metadataEntry.scopedMetadataKey.toHex().toLocaleLowerCase() === key); @@ -93,9 +93,9 @@ export class ApostilleUtils { /** * Check if two metadata values are identical - * @param {string} firstValue A value - * @param {string} secondValue A value - * @return {boolean} True if identical, false otherwise + * @param {string} firstValue - A value + * @param {string} secondValue - A value + * @return {boolean} - True if identical, false otherwise */ public static isIdentical(firstValue: string, secondValue: string): boolean { if (firstValue === secondValue) return true; @@ -104,8 +104,8 @@ export class ApostilleUtils { /** * Extract dedicated account from file name in Apostille format - * @param {string} filename File name in Apostille format (Ex: "MyProject - TBLJAVZXTDY3EXNVC5IMEYZN35OPHAQK5GOQXWPH - 2020-01-29.txt") - * @return {Address} Dedicated account or undefined + * @param {string} filename - File name in Apostille format (Ex: "MyProject - TBLJAVZXTDY3EXNVC5IMEYZN35OPHAQK5GOQXWPH - 2020-01-29.txt") + * @return {Address} - Dedicated account or undefined */ public static extractDedicatedFromName(filename: string): Address { const arr = filename.split(" "); @@ -119,8 +119,8 @@ export class ApostilleUtils { /** * Retrieve original file name from file name in Apostille format - * @param {string} filename File name in Apostille format (Ex: "MyProject - TBLJAVZXTDY3EXNVC5IMEYZN35OPHAQK5GOQXWPH - 2020-01-29.txt") - * @return {string} Original file name with extension + * @param {string} filename - File name in Apostille format (Ex: "MyProject - TBLJAVZXTDY3EXNVC5IMEYZN35OPHAQK5GOQXWPH - 2020-01-29.txt") + * @return {string} - Original file name with extension */ public static getOriginalFilename(filename: string): string { const arr = filename.split(" "); diff --git a/src/ApostilleVerification.ts b/src/ApostilleVerification.ts index 671534b..6b2299a 100644 --- a/src/ApostilleVerification.ts +++ b/src/ApostilleVerification.ts @@ -24,9 +24,9 @@ export class ApostilleVerification { /** * Verify an Apostille - * @param {string} filename Name of the file in Apostille format (Ex: "MyProject - TBLJAVZXTDY3EXNVC5IMEYZN35OPHAQK5GOQXWPH - 2020-01-29.txt") - * @param {string} data File content (as Base64) - * @param {Metadata[]} metadata Dedicated account's metadata + * @param {string} filename - Name of the file in Apostille format (Ex: "MyProject - TBLJAVZXTDY3EXNVC5IMEYZN35OPHAQK5GOQXWPH - 2020-01-29.txt") + * @param {string} data - File content (as Base64) + * @param {Metadata[]} metadata - Dedicated account's metadata * @return {ApostilleVerificationResult} */ public static verify(filename: string, data: string, metadata: Metadata[]): ApostilleVerificationResult { @@ -41,11 +41,11 @@ export class ApostilleVerification { /** * Verify an Apostille hash signature - * @param {string} publicKey Public key of owner - * @param {string} data File content (as Base64) - * @param {string} hash Apostille hash - * @param {NetworkType} network Network type - * @return {boolean} True if hash signature is valid, false otherwise + * @param {string} publicKey - Public key of owner + * @param {string} data - File content (as Base64) + * @param {string} hash - Apostille hash + * @param {NetworkType} network - Network type + * @return {boolean} - True if hash signature is valid, false otherwise */ public static verifyHash(publicKey: string, data: string, hash: string, network: NetworkType): boolean { const owner = PublicAccount.createFromPublicKey(publicKey, network); diff --git a/src/ApostilleVerificationResult.ts b/src/ApostilleVerificationResult.ts index 3423401..5be0d1e 100644 --- a/src/ApostilleVerificationResult.ts +++ b/src/ApostilleVerificationResult.ts @@ -25,9 +25,9 @@ export class ApostilleVerificationResult { /** * Create an object containing the Apostille verification result - * @param {number} code Result code - * @param {boolean} result Verification result - * @param {ApostilleMetadata} metadata Apostille metadata (optional) + * @param {number} code - Result code + * @param {boolean} result - Verification result + * @param {ApostilleMetadata} metadata - Apostille metadata (optional) * @return {ApostilleVerificationResult} */ public static create(code: number, result: boolean, metadata: ApostilleMetadata = undefined): ApostilleVerificationResult {