"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BootstrapperForAuthDmzCommands = void 0;
require("reflect-metadata");
const codiac_api_1 = require("./apis/codiac-api");
const uilogic_1 = require("./uilogic");
const bootstrapper_for_codiac_cli_1 = require("./bootstrapper-for-codiac-cli");
class BootstrapperForAuthDmzCommands {
    static bootstrap(ioc, cmd) {
        if (this.isBootstrapped == true) {
            return;
        }
        bootstrapper_for_codiac_cli_1.BootstrapperForCodiacCli.bootstrap(ioc, cmd.config, false);
        // We only need the auth client here, so we dont need to run the whole enterprise bootstrapper.
        // Q: Even so, why not just extend CommandBaseExecTenant?  Is that bootstrapper really that slow?
        // A: Because the TenantContextualizer will fire, which we dont want in this case 
        //    bc it doesnt have a registration workflow in it (and shouldnt).
        // This is just a prereq for IAuthClient...
        // const codiacApiUrl = cmd.localConfig?.apiUrl ?? cmd._cliCfg.codiacApiBaseUrl ?? CodiacRestClient.DEFAULT_API_URL;
        codiac_api_1.CodiacRestClient.bootstrap(ioc);
        ioc.bind(codiac_api_1.CodiacRestClient).toDynamicValue(() => codiac_api_1.CodiacRestClient.create(cmd.logger, cmd._cliCfg.codiacApiBaseUrl));
        // ioc.bind<ICodiacClient>(INTERFACES_CLI_ENTERPRISE.ICodiacClient).toDynamicValue(ctx => ctx.container.get(CodiacRestClient));  // Use the Codiac rest api client for this.
        ioc.bind(uilogic_1.INTERFACES_CLI_ENTERPRISE.IAuthClient).toDynamicValue(ctx => ctx.container.get(codiac_api_1.CodiacRestClient)); // Use the Codiac rest api client for this.
        this.isBootstrapped = true;
    }
}
exports.BootstrapperForAuthDmzCommands = BootstrapperForAuthDmzCommands;
BootstrapperForAuthDmzCommands.isBootstrapped = false;
//# sourceMappingURL=bootstrapper-for-auth-dmz-commands.js.map