"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnsupportedResourceConfigurator = void 0;
const tslib_1 = require("tslib");
const codiac_relay_1 = require("../../apis/codiac-relay");
const codiac_common_1 = require("@codiac.io/codiac-common");
const codiac_domain_1 = require("@codiac.io/codiac-domain");
const inversify_1 = require("inversify");
const ops_1 = require("../../ops");
const cloud_resource_configurator_factory_1 = require("../cloud-resource-configurator-factory");
/** Walks the user through the selection of an existing
 * or the declaration of a new image registry.
 */
let UnsupportedResourceConfigurator = class UnsupportedResourceConfigurator {
    constructor(codiacApi, relayClient, ui, logger) {
        this.codiacApi = codiacApi;
        this.relayClient = relayClient;
        this.ui = ui;
        this.logger = logger;
        this.cloudProvider = codiac_domain_1.CloudProviderEnum.other;
    }
    captureImageRegistry() {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            return new Promise((resolve, reject) => tslib_1.__awaiter(this, void 0, void 0, function* () {
                let output;
                try {
                    //   // Unknown registry client type; Just prompt for unvalidated strings on registry and image
                    //   // Enter registry Url
                    //   while (!img.registryUrl || img.registryUrl == "") {
                    //     let regResult = await this._ui.prompt('registry', 'image registry: ', true, img.registryUrl || DEFAULT_REGISTRY_URL);
                    //     img.registryUrl = regResult.registry;
                    //   }
                    //   // Enter scoped image name
                    //   img.name = await this._ui.prompt('fullName', 'image name (including scope prefix): ', true, img.name || defaults.name);
                    //   let split = imageFullName.split("/");
                    //   if (split.length > 1) {
                    //     img.scope = split.shift();
                    //     img.name = split.join("/");
                    //   }
                    throw new Error('Not yet implemented...');
                    resolve(output);
                }
                catch (err) {
                    // this.logger.error(`${err.name ?? ''} ${err.message ?? ''}`, err.stack);
                    reject(err);
                }
            }));
        });
    }
};
UnsupportedResourceConfigurator = tslib_1.__decorate([
    (0, inversify_1.injectable)(),
    tslib_1.__param(0, (0, inversify_1.inject)(cloud_resource_configurator_factory_1.INTERFACES_CLI_ENTERPRISE.ICodiacClient)),
    tslib_1.__param(1, (0, inversify_1.inject)(codiac_relay_1.RelayClient)),
    tslib_1.__param(2, (0, inversify_1.inject)(ops_1.INTERFACES_CLI.IUserInputProvider)),
    tslib_1.__param(3, (0, inversify_1.inject)(codiac_common_1.INTERFACES.IBetterLogger)),
    tslib_1.__metadata("design:paramtypes", [Object, codiac_relay_1.RelayClient, Object, Object])
], UnsupportedResourceConfigurator);
exports.UnsupportedResourceConfigurator = UnsupportedResourceConfigurator;
//# sourceMappingURL=unsupported-resource-configurator.js.map