From afb936cc5e22d96115472cdfc16908299db5e9dd Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 16 May 2023 10:01:27 -0700 Subject: [PATCH] deps: tuf-js@1.1.6 --- DEPENDENCIES.md | 1 + node_modules/tuf-js/dist/fetcher.js | 3 +++ node_modules/tuf-js/dist/updater.js | 8 ++++++++ node_modules/tuf-js/package.json | 10 ++++++---- package-lock.json | 7 ++++--- 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index a7df0ec604f95..192c9cdf7903c 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -789,6 +789,7 @@ graph LR; tar-->minizlib; tar-->mkdirp; tar-->yallist; + tuf-js-->debug; tuf-js-->make-fetch-happen; tuf-js-->tufjs-models["@tufjs/models"]; tufjs-models-->minimatch; diff --git a/node_modules/tuf-js/dist/fetcher.js b/node_modules/tuf-js/dist/fetcher.js index 7a7405ac53e72..d3dcf53eeb869 100644 --- a/node_modules/tuf-js/dist/fetcher.js +++ b/node_modules/tuf-js/dist/fetcher.js @@ -4,11 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.DefaultFetcher = exports.BaseFetcher = void 0; +const debug_1 = __importDefault(require("debug")); const fs_1 = __importDefault(require("fs")); const make_fetch_happen_1 = __importDefault(require("make-fetch-happen")); const util_1 = __importDefault(require("util")); const error_1 = require("./error"); const tmpfile_1 = require("./utils/tmpfile"); +const log = (0, debug_1.default)('tuf:fetch'); class BaseFetcher { // Download file from given URL. The file is downloaded to a temporary // location and then passed to the given handler. The handler is responsible @@ -58,6 +60,7 @@ class DefaultFetcher extends BaseFetcher { this.retries = options.retries; } async fetch(url) { + log('GET %s', url); const response = await (0, make_fetch_happen_1.default)(url, { timeout: this.timeout, retry: this.retries, diff --git a/node_modules/tuf-js/dist/updater.js b/node_modules/tuf-js/dist/updater.js index 68243e554facb..71fa4981e3122 100644 --- a/node_modules/tuf-js/dist/updater.js +++ b/node_modules/tuf-js/dist/updater.js @@ -22,9 +22,13 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", { value: true }); exports.Updater = void 0; const models_1 = require("@tufjs/models"); +const debug_1 = __importDefault(require("debug")); const fs = __importStar(require("fs")); const path = __importStar(require("path")); const config_1 = require("./config"); @@ -32,6 +36,7 @@ const error_1 = require("./error"); const fetcher_1 = require("./fetcher"); const store_1 = require("./store"); const url = __importStar(require("./utils/url")); +const log = (0, debug_1.default)('tuf:cache'); class Updater { constructor(options) { const { metadataDir, metadataBaseUrl, targetDir, targetBaseUrl, fetcher, config, } = options; @@ -86,6 +91,7 @@ class Updater { // Verify hashes and length of downloaded file await targetInfo.verify(fs.createReadStream(fileName)); // Copy file to target path + log('WRITE %s', targetPath); fs.copyFileSync(fileName, targetPath); }); return targetPath; @@ -107,6 +113,7 @@ class Updater { } loadLocalMetadata(fileName) { const filePath = path.join(this.dir, `${fileName}.json`); + log('READ %s', filePath); return fs.readFileSync(filePath); } // Sequentially load and persist on local disk every newer root metadata @@ -300,6 +307,7 @@ class Updater { async persistMetadata(metaDataName, bytesData) { try { const filePath = path.join(this.dir, `${metaDataName}.json`); + log('WRITE %s', filePath); fs.writeFileSync(filePath, bytesData.toString('utf8')); } catch (error) { diff --git a/node_modules/tuf-js/package.json b/node_modules/tuf-js/package.json index ab84004c49403..c1134af2b2ff3 100644 --- a/node_modules/tuf-js/package.json +++ b/node_modules/tuf-js/package.json @@ -1,6 +1,6 @@ { "name": "tuf-js", - "version": "1.1.5", + "version": "1.1.6", "description": "JavaScript implementation of The Update Framework (TUF)", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -29,14 +29,16 @@ "homepage": "https://github.com/theupdateframework/tuf-js/tree/main/packages/client#readme", "devDependencies": { "@tufjs/repo-mock": "1.3.1", + "@types/debug": "^4.1.7", "@types/make-fetch-happen": "^10.0.1", - "@types/node": "^18.16.3", + "@types/node": "^20.1.1", "nock": "^13.3.1", "typescript": "^5.0.4" }, "dependencies": { - "make-fetch-happen": "^11.1.0", - "@tufjs/models": "1.0.4" + "@tufjs/models": "1.0.4", + "debug": "^4.3.4", + "make-fetch-happen": "^11.1.0" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" diff --git a/package-lock.json b/package-lock.json index 2fa7b733d2736..903dd857b7a57 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14518,12 +14518,13 @@ } }, "node_modules/tuf-js": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-1.1.5.tgz", - "integrity": "sha512-inqodgxdsmuxrtQVbu6tPNgRKWD1Boy3VB6GO7KczJZpAHiTukwhSzXUSzvDcw5pE2Jo8ua+e1ykpHv7VdPVlQ==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-1.1.6.tgz", + "integrity": "sha512-CXwFVIsXGbVY4vFiWF7TJKWmlKJAT8TWkH4RmiohJRcDJInix++F0dznDmoVbtJNzZ8yLprKUG4YrDIhv3nBMg==", "inBundle": true, "dependencies": { "@tufjs/models": "1.0.4", + "debug": "^4.3.4", "make-fetch-happen": "^11.1.0" }, "engines": {