"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.HetznerProviderModule = void 0;
const common_1 = require("@nestjs/common");
const cloud_provider_enum_1 = require("../../enums/cloud-provider.enum");
const dns_provider_enum_1 = require("../../enums/dns-provider.enum");
const hetzner_provider_service_1 = require("../../services/hetzner-provider.service");
const hetzner_firewall_service_1 = require("../../services/hetzner-firewall.service");
const hetzner_dns_service_1 = require("../../services/hetzner-dns.service");
const hetzner_capabilities_service_1 = require("./hetzner-capabilities.service");
const hetzner_bootstrap_seeder_service_1 = require("./hetzner-bootstrap-seeder.service");
const shared_infrastructure_module_1 = require("../../../infrastructure/shared/shared-infrastructure.module");
const tokens_1 = require("../../core/tokens");
let HetznerProviderModule = class HetznerProviderModule {
};
exports.HetznerProviderModule = HetznerProviderModule;
exports.HetznerProviderModule = HetznerProviderModule = __decorate([
    (0, common_1.Module)({
        imports: [shared_infrastructure_module_1.SharedInfrastructureModule],
        providers: [
            hetzner_provider_service_1.HetznerProviderService,
            hetzner_firewall_service_1.HetznerFirewallService,
            hetzner_dns_service_1.HetznerDnsService,
            hetzner_capabilities_service_1.HetznerCapabilitiesService,
            hetzner_bootstrap_seeder_service_1.HetznerBootstrapSeeder,
            (0, tokens_1.multiProvider)({
                provide: tokens_1.CAPABILITIES_PROVIDER_REGISTRY,
                useFactory: (s) => ({
                    provider: cloud_provider_enum_1.CloudProvider.HETZNER,
                    service: s,
                }),
                inject: [hetzner_capabilities_service_1.HetznerCapabilitiesService],
                multi: true,
            }),
            (0, tokens_1.multiProvider)({
                provide: tokens_1.CLOUD_PROVIDER_REGISTRY,
                useFactory: (s) => ({
                    provider: cloud_provider_enum_1.CloudProvider.HETZNER,
                    service: s,
                }),
                inject: [hetzner_provider_service_1.HetznerProviderService],
                multi: true,
            }),
            (0, tokens_1.multiProvider)({
                provide: tokens_1.FIREWALL_PROVIDER_REGISTRY,
                useFactory: (s) => ({
                    provider: cloud_provider_enum_1.CloudProvider.HETZNER,
                    service: s,
                }),
                inject: [hetzner_firewall_service_1.HetznerFirewallService],
                multi: true,
            }),
            (0, tokens_1.multiProvider)({
                provide: tokens_1.DNS_PROVIDER_REGISTRY,
                useFactory: (s) => ({
                    provider: dns_provider_enum_1.DnsProvider.HETZNER,
                    service: s,
                }),
                inject: [hetzner_dns_service_1.HetznerDnsService],
                multi: true,
            }),
        ],
        exports: [
            hetzner_provider_service_1.HetznerProviderService,
            hetzner_firewall_service_1.HetznerFirewallService,
            hetzner_dns_service_1.HetznerDnsService,
            hetzner_capabilities_service_1.HetznerCapabilitiesService,
            hetzner_bootstrap_seeder_service_1.HetznerBootstrapSeeder,
            tokens_1.CLOUD_PROVIDER_REGISTRY,
            tokens_1.FIREWALL_PROVIDER_REGISTRY,
            tokens_1.DNS_PROVIDER_REGISTRY,
            tokens_1.CAPABILITIES_PROVIDER_REGISTRY,
        ],
    })
], HetznerProviderModule);
