| 1 |
"use strict"; |
| 2 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 3 |
exports.initializeTUFRepo = initializeTUFRepo; |
| 4 |
const key_1 = require("./key"); |
| 5 |
const metadata_1 = require("./metadata"); |
| 6 |
const target_1 = require("./target"); |
| 7 |
function initializeTUFRepo(targets) { |
| 8 |
const keyPair = new key_1.KeyPair(); |
| 9 |
|
| 10 |
const targetFiles = (0, target_1.collectTargets)(targets); |
| 11 |
|
| 12 |
const targetsMeta = (0, metadata_1.createTargetsMeta)(targetFiles, keyPair); |
| 13 |
const snapshotMeta = (0, metadata_1.createSnapshotMeta)(targetsMeta, keyPair); |
| 14 |
const timestampMeta = (0, metadata_1.createTimestampMeta)(snapshotMeta, keyPair); |
| 15 |
const rootMeta = (0, metadata_1.createRootMeta)(keyPair); |
| 16 |
return { |
| 17 |
rootMeta, |
| 18 |
snapshotMeta, |
| 19 |
timestampMeta, |
| 20 |
targetsMeta, |
| 21 |
targets, |
| 22 |
}; |
| 23 |
} |