diff --git a/package-lock.json b/package-lock.json index dea92f7f..f9b2616f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,9 +14,9 @@ "@inquirer/prompts": "8.5.2", "@internxt/inxt-js": "3.3.5", "@internxt/lib": "1.5.1", - "@internxt/sdk": "1.17.17", - "@oclif/core": "4.13.0", - "@oclif/plugin-autocomplete": "3.2.53", + "@internxt/sdk": "1.19.0", + "@oclif/core": "4.13.2", + "@oclif/plugin-autocomplete": "3.2.54", "axios": "1.18.1", "better-sqlite3": "12.11.1", "bip39": "3.1.0", @@ -50,7 +50,7 @@ "@types/cli-progress": "^3.11.6", "@types/express": "^5.0.6", "@types/mime-types": "^3.0.1", - "@types/node": "^26.1.1", + "@types/node": "^26.1.2", "@types/range-parser": "^1.2.7", "@vitest/coverage-istanbul": "^4.1.10", "@vitest/spy": "^4.1.10", @@ -58,7 +58,7 @@ "husky": "^9.1.7", "lint-staged": "^17.2.0", "nodemon": "^3.1.14", - "oclif": "^4.23.27", + "oclif": "^4.23.29", "prettier": "^3.9.6", "rimraf": "^6.1.3", "sql.js": "^1.14.1", @@ -1894,9 +1894,9 @@ "license": "MIT" }, "node_modules/@internxt/sdk": { - "version": "1.17.17", - "resolved": "https://registry.npmjs.org/@internxt/sdk/-/sdk-1.17.17.tgz", - "integrity": "sha512-bzFyXjo4I5AcqlS0vyBsjyC34U5ptx281wikTVg4pXB8P2mrY9p4ZpmQ8Eh79NEVDQWKnSiTtpxVNuSgHKB/5Q==", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/@internxt/sdk/-/sdk-1.19.0.tgz", + "integrity": "sha512-u5s7+FSUwZSjW4vhLAnfnjRtqEdAYnxUmqNBY6YC3chap27e3kJUM9jfJhpxRNckmxYbaUrLG8l8wfo/dlWe/g==", "license": "MIT", "dependencies": { "axios": "^1.16.0" @@ -2006,9 +2006,9 @@ "license": "MIT" }, "node_modules/@oclif/core": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@oclif/core/-/core-4.13.0.tgz", - "integrity": "sha512-j3NKgXE3qd0gvSYsCqDLb3VhW5KEg030VQhMnv5c0qNzPp6jBmF7cCDIQG4ROZIOqEfGbUoDDMAAzaC30vV99g==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@oclif/core/-/core-4.13.2.tgz", + "integrity": "sha512-YWQs0JvESCliWopKtCZqPLgEB1e3oqR+KYecMReseYWbo7E73Rz2tFwQDFQtAp48VLMiAsiTPKKQaZAo+ghzLw==", "license": "MIT", "dependencies": { "ansi-escapes": "^4.3.2", @@ -2035,9 +2035,9 @@ } }, "node_modules/@oclif/plugin-autocomplete": { - "version": "3.2.53", - "resolved": "https://registry.npmjs.org/@oclif/plugin-autocomplete/-/plugin-autocomplete-3.2.53.tgz", - "integrity": "sha512-cGAgN9ujTDxa6C84d6XNVsmoFnDFfHwdiykAnAfym3oBLxoXBNYMZhmfnZ8KBWDy/r/DYf11BrGJwqKl2P0iSA==", + "version": "3.2.54", + "resolved": "https://registry.npmjs.org/@oclif/plugin-autocomplete/-/plugin-autocomplete-3.2.54.tgz", + "integrity": "sha512-1FsvWR/T4UAcydM7JJgl1tn697Z51S+jLNL7Y/R8FXsU6HI/i9Ib+iSf0Vn+5Kjzm3iE1A6KzB5uz72Ic62ivg==", "license": "MIT", "dependencies": { "@oclif/core": "^4", @@ -3388,9 +3388,9 @@ } }, "node_modules/@types/node": { - "version": "26.1.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz", - "integrity": "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==", + "version": "26.1.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.2.tgz", + "integrity": "sha512-Vu4a5UFA9rIIFJ7rB/Vaafh9lrCQszopTCx6KjFboXTGQbPNasehVR5TEiithSDGyd1DEiUByggTZsg8jukeIg==", "devOptional": true, "license": "MIT", "dependencies": { @@ -8473,9 +8473,9 @@ } }, "node_modules/oclif": { - "version": "4.23.27", - "resolved": "https://registry.npmjs.org/oclif/-/oclif-4.23.27.tgz", - "integrity": "sha512-DNUQ22pglqstzuTRb+E4yjJI20PVGNGHCJa/vzH3HQCrS0B0GQPjWwIeMWjgWaQHBi1oXO2jMDHHpCLDNgW/tQ==", + "version": "4.23.29", + "resolved": "https://registry.npmjs.org/oclif/-/oclif-4.23.29.tgz", + "integrity": "sha512-pUekmMh+wwIbFq3xX1EfkgZ7RuYuuSbdhJiB+20zqSfGE8Tt9T+K9br1/vmsaIOxfDo0Dw3jxLBk4JZOMFEMeQ==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 5927df40..cbb0ac62 100644 --- a/package.json +++ b/package.json @@ -40,9 +40,9 @@ "@inquirer/prompts": "8.5.2", "@internxt/inxt-js": "3.3.5", "@internxt/lib": "1.5.1", - "@internxt/sdk": "1.17.17", - "@oclif/core": "4.13.0", - "@oclif/plugin-autocomplete": "3.2.53", + "@internxt/sdk": "1.19.0", + "@oclif/core": "4.13.2", + "@oclif/plugin-autocomplete": "3.2.54", "axios": "1.18.1", "better-sqlite3": "12.11.1", "bip39": "3.1.0", @@ -73,7 +73,7 @@ "@types/cli-progress": "^3.11.6", "@types/express": "^5.0.6", "@types/mime-types": "^3.0.1", - "@types/node": "^26.1.1", + "@types/node": "^26.1.2", "@types/range-parser": "^1.2.7", "@vitest/coverage-istanbul": "^4.1.10", "@vitest/spy": "^4.1.10", @@ -81,7 +81,7 @@ "husky": "^9.1.7", "lint-staged": "^17.2.0", "nodemon": "^3.1.14", - "oclif": "^4.23.27", + "oclif": "^4.23.29", "prettier": "^3.9.6", "rimraf": "^6.1.3", "sql.js": "^1.14.1", diff --git a/src/services/crypto.service.ts b/src/services/crypto.service.ts index 21b23c75..4a3dbc27 100644 --- a/src/services/crypto.service.ts +++ b/src/services/crypto.service.ts @@ -18,12 +18,9 @@ export class CryptoService { return CryptoService.instance.encryptText(hashObj.hash); }, async generateKeys(password: Password): Promise { - const { privateKeyArmoredEncrypted, publicKeyArmored, revocationCertificate } = + const { privateKeyArmoredEncrypted, publicKeyArmored } = await KeysService.instance.generateNewKeysWithEncrypted(password); const keys: Keys = { - privateKeyEncrypted: privateKeyArmoredEncrypted, - publicKey: publicKeyArmored, - revocationCertificate: revocationCertificate, ecc: { privateKeyEncrypted: privateKeyArmoredEncrypted, publicKey: publicKeyArmored, diff --git a/test/services/crypto.service.test.ts b/test/services/crypto.service.test.ts index 62476b7c..52b1943c 100644 --- a/test/services/crypto.service.test.ts +++ b/test/services/crypto.service.test.ts @@ -87,9 +87,6 @@ describe('Crypto service', () => { .mockResolvedValue(keysReturned); const expectedKeys: Keys = { - privateKeyEncrypted: keysReturned.privateKeyArmoredEncrypted, - publicKey: keysReturned.publicKeyArmored, - revocationCertificate: keysReturned.revocationCertificate, ecc: { privateKeyEncrypted: keysReturned.privateKeyArmoredEncrypted, publicKey: keysReturned.publicKeyArmored, diff --git a/test/services/keys.service.test.ts b/test/services/keys.service.test.ts index 91d398fd..07b937f0 100644 --- a/test/services/keys.service.test.ts +++ b/test/services/keys.service.test.ts @@ -28,16 +28,17 @@ describe('Keys service', () => { }); test('when new encryption keys are needed, then they are generated using the cryptography library', async () => { - interface KeyPair { + interface PgpGenerationKeys { privateKey: openpgp.PrivateKey; publicKey: openpgp.PublicKey; + revocationCertificate: string; } const pgpKeys = { privateKey: crypto.randomBytes(16).toString('hex'), publicKey: crypto.randomBytes(16).toString('hex'), revocationCertificate: crypto.randomBytes(16).toString('hex'), - } as unknown as KeyPair & { revocationCertificate: string }; + } as unknown as PgpGenerationKeys; const pgpKeysWithEncrypted = { privateKeyArmored: pgpKeys.privateKey,