avancement planning

This commit is contained in:
2026-05-26 11:58:39 +02:00
parent 619a2b240a
commit 150b97cd2e
4892 changed files with 99214 additions and 429382 deletions
+5
View File
@@ -23,9 +23,11 @@ const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
const tuf_js_1 = require("tuf-js");
const _1 = require(".");
const package_json_1 = require("../package.json");
const target_1 = require("./target");
const TARGETS_DIR_NAME = 'targets';
class TUFClient {
updater;
constructor(options) {
const url = new URL(options.mirrorURL);
const repoName = encodeURIComponent(url.host + url.pathname.replace(/\/$/, ''));
@@ -63,6 +65,7 @@ function initTufCache(cachePath) {
if (!fs_1.default.existsSync(cachePath)) {
fs_1.default.mkdirSync(cachePath, { recursive: true });
}
/* istanbul ignore else */
if (!fs_1.default.existsSync(targetsPath)) {
fs_1.default.mkdirSync(targetsPath);
}
@@ -74,6 +77,7 @@ function seedCache({ cachePath, mirrorURL, tufRootPath, forceInit, }) {
const cachedRootPath = path_1.default.join(cachePath, 'root.json');
// If the root.json file does not exist (or we're forcing re-initialization),
// populate it either from the supplied rootPath or from one of the repo seeds.
/* istanbul ignore else */
if (!fs_1.default.existsSync(cachedRootPath) || forceInit) {
if (tufRootPath) {
fs_1.default.copyFileSync(tufRootPath, cachedRootPath);
@@ -99,6 +103,7 @@ function initClient(options) {
const config = {
fetchTimeout: options.timeout,
fetchRetry: options.retry,
userAgent: `${encodeURIComponent(package_json_1.name)}/${package_json_1.version}`,
};
return new tuf_js_1.Updater({
metadataBaseUrl: options.mirrorURL,
+2
View File
@@ -2,6 +2,8 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.TUFError = void 0;
class TUFError extends Error {
code;
cause;
constructor({ code, message, cause, }) {
super(message);
this.code = code;