"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TestimApi = void 0;
const testimAuthApi_1 = require("./testimAuthApi");
const testimExecutionsApi_1 = require("./testimExecutionsApi");
const testimAssetsApi_1 = require("./testimAssetsApi");
const rootCauseExecutionsApi_1 = require("./rootCauseExecutionsApi");
var testimAuthApi_2 = require("./testimAuthApi");
Object.defineProperty(exports, "TestimAuthApi", { enumerable: true, get: function () { return testimAuthApi_2.TestimAuthApi; } });
var testimExecutionsApi_2 = require("./testimExecutionsApi");
Object.defineProperty(exports, "TestimExecutionsApi", { enumerable: true, get: function () { return testimExecutionsApi_2.TestimExecutionsApi; } });
var testimAssetsApi_2 = require("./testimAssetsApi");
Object.defineProperty(exports, "TestimAssetsApi", { enumerable: true, get: function () { return testimAssetsApi_2.TestimAssetsApi; } });
var rootCauseExecutionsApi_2 = require("./rootCauseExecutionsApi");
Object.defineProperty(exports, "RootCauseExecutionsApi", { enumerable: true, get: function () { return rootCauseExecutionsApi_2.RootCauseExecutionsApi; } });
class TestimApi {
    constructor(baseUrl, fetch) {
        this.auth = new testimAuthApi_1.TestimAuthApi(baseUrl, fetch);
        this.assets = new testimAssetsApi_1.TestimAssetsApi(baseUrl, this.auth, undefined, fetch);
        this.executions = new testimExecutionsApi_1.TestimExecutionsApi(baseUrl, this.auth, fetch);
        this.executionsApi = new rootCauseExecutionsApi_1.RootCauseExecutionsApi(this.executions, this.assets);
    }
    async authenticate(projectId, ciToken, signal) {
        await this.auth.getToken(projectId, ciToken, signal);
        this.projectId = projectId;
        this.ciToken = ciToken;
    }
}
exports.TestimApi = TestimApi;
