"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CodiacSdkForCli = void 0;
const uilogic_1 = require("../uilogic");
class CodiacSdkForCli {
    /**
     *
     * @param ioc Inversion of Control container for the system.
     *
     * DEV NOTE: *let's try to keep this private by exposing type-safe public bootstrapping methods
     * that provide explicit guidance and enable the consumer to integrate their components
     * without having to know how the system is set up internally).*
     */
    constructor(ioc) {
        this.ioc = ioc;
    }
    registerCspAdapter(constructor) {
        try {
            const adapter = new constructor();
            adapter.bootstrap(this);
        }
        catch (err) {
            throw err;
        }
    }
    registerContainerRegistryConfigurator(provider, constructor) {
        if (this.ioc.isBoundNamed(uilogic_1.INTERFACES_CLI_ENTERPRISE.IRegistryConfigurator, provider)) {
            throw new Error("Cannot re-register an IRegistryConfigurator");
        }
        else {
            this.ioc.bind(uilogic_1.INTERFACES_CLI_ENTERPRISE.IRegistryConfigurator)
                .to(constructor)
                .whenTargetNamed(provider);
        }
        return;
    }
    registerClusterConfigurator(provider, constructor) {
        if (this.ioc.isBoundNamed(uilogic_1.INTERFACES_CLI_ENTERPRISE.IClusterConfigurator, provider)) {
            throw new Error("Cannot re-register an IClusterConfigurator");
        }
        else {
            this.ioc.bind(uilogic_1.INTERFACES_CLI_ENTERPRISE.IClusterConfigurator)
                .to(constructor)
                .whenTargetNamed(provider);
        }
        return;
    }
    registerFileStoreConfigurator(provider, constructor) {
        if (this.ioc.isBoundNamed(uilogic_1.INTERFACES_CLI_ENTERPRISE.IFileStoreConfigurator, provider)) {
            throw new Error("Cannot re-register an IFileStoreConfigurator");
        }
        else {
            this.ioc.bind(uilogic_1.INTERFACES_CLI_ENTERPRISE.IFileStoreConfigurator)
                .to(constructor)
                .whenTargetNamed(provider);
        }
        return;
    }
    registerSecretStoreConfigurator(provider, constructor) {
        if (this.ioc.isBoundNamed(uilogic_1.INTERFACES_CLI_ENTERPRISE.ISecretStoreConfigurator, provider)) {
            throw new Error("Cannot re-register an ISecretStoreConfigurator");
        }
        else {
            this.ioc.bind(uilogic_1.INTERFACES_CLI_ENTERPRISE.ISecretStoreConfigurator)
                .to(constructor)
                .whenTargetNamed(provider);
        }
        return;
    }
    registerLoginConfigurator(provider, constructor) {
        if (this.ioc.isBoundNamed(uilogic_1.INTERFACES_CLI_ENTERPRISE.ILoginConfigurator, provider)) {
            throw new Error("Cannot re-register an ILoginConfigurator");
        }
        else {
            this.ioc.bind(uilogic_1.INTERFACES_CLI_ENTERPRISE.ILoginConfigurator)
                .to(constructor)
                .whenTargetNamed(provider);
        }
        return;
    }
}
exports.CodiacSdkForCli = CodiacSdkForCli;
//# sourceMappingURL=codiac-sdk-for-cli.js.map