"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContaboProviderModule = void 0;
const common_1 = require("@nestjs/common");
const config_1 = require("@nestjs/config");
const cloud_provider_enum_1 = require("../../enums/cloud-provider.enum");
const contabo_provider_service_1 = require("../../services/contabo-provider.service");
const contabo_firewall_service_1 = require("../../services/contabo-firewall.service");
const contabo_capabilities_service_1 = require("./contabo-capabilities.service");
const tokens_1 = require("../../core/tokens");
/**
 * Contabo provider module — auto-registers all Contabo services into the global registry.
 *
 * Services depend on 'ICredentialProvider' which must be provided globally
 * by the parent module (ProvidersModule / CliProvidersModule marked @Global()).
 *
 * To add Contabo to the system: import ContaboProviderModule in ProvidersModule.
 */
let ContaboProviderModule = class ContaboProviderModule {
};
exports.ContaboProviderModule = ContaboProviderModule;
exports.ContaboProviderModule = ContaboProviderModule = __decorate([
    (0, common_1.Module)({
        imports: [config_1.ConfigModule],
        providers: [
            contabo_provider_service_1.ContaboProviderService,
            contabo_firewall_service_1.ContaboFirewallService,
            contabo_capabilities_service_1.ContaboCapabilitiesService,
            (0, tokens_1.multiProvider)({
                provide: tokens_1.CAPABILITIES_PROVIDER_REGISTRY,
                useFactory: (s) => ({
                    provider: cloud_provider_enum_1.CloudProvider.CONTABO,
                    service: s,
                }),
                inject: [contabo_capabilities_service_1.ContaboCapabilitiesService],
                multi: true,
            }),
            (0, tokens_1.multiProvider)({
                provide: tokens_1.CLOUD_PROVIDER_REGISTRY,
                useFactory: (s) => ({
                    provider: cloud_provider_enum_1.CloudProvider.CONTABO,
                    service: s,
                }),
                inject: [contabo_provider_service_1.ContaboProviderService],
                multi: true,
            }),
            (0, tokens_1.multiProvider)({
                provide: tokens_1.FIREWALL_PROVIDER_REGISTRY,
                useFactory: (s) => ({
                    provider: cloud_provider_enum_1.CloudProvider.CONTABO,
                    service: s,
                }),
                inject: [contabo_firewall_service_1.ContaboFirewallService],
                multi: true,
            }),
        ],
        exports: [
            contabo_provider_service_1.ContaboProviderService,
            contabo_firewall_service_1.ContaboFirewallService,
            contabo_capabilities_service_1.ContaboCapabilitiesService,
            tokens_1.CLOUD_PROVIDER_REGISTRY,
            tokens_1.FIREWALL_PROVIDER_REGISTRY,
            tokens_1.CAPABILITIES_PROVIDER_REGISTRY,
        ],
    })
], ContaboProviderModule);
