"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initializeTUFRepo = initializeTUFRepo;
const key_1 = require("./key");
const metadata_1 = require("./metadata");
const target_1 = require("./target");
function initializeTUFRepo(targets) {
    const keyPair = new key_1.KeyPair();
    // Translate the input targets into TUF TargetFile objects
    const targetFiles = (0, target_1.collectTargets)(targets);
    // Generate all of the TUF metadata objects
    const targetsMeta = (0, metadata_1.createTargetsMeta)(targetFiles, keyPair);
    const snapshotMeta = (0, metadata_1.createSnapshotMeta)(targetsMeta, keyPair);
    const timestampMeta = (0, metadata_1.createTimestampMeta)(snapshotMeta, keyPair);
    const rootMeta = (0, metadata_1.createRootMeta)(keyPair);
    return {
        rootMeta,
        snapshotMeta,
        timestampMeta,
        targetsMeta,
        targets,
    };
}
