"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;
};
var UnifiProvider_1;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnifiProvider = void 0;
const common_1 = require("@nestjs/common");
let UnifiProvider = UnifiProvider_1 = class UnifiProvider {
    constructor() {
        this.logger = new common_1.Logger(UnifiProvider_1.name);
    }
    async connect(router) {
        this.logger.warn(`UniFi provider is not fully implemented for router ${router.id}`);
        return false;
    }
    async disconnect(_router) {
        return;
    }
    async testConnection(router) {
        try {
            const host = router.host;
            const port = router.apiPort || 8443;
            this.logger.log(`Testing UniFi connectivity to ${host}:${port} for router ${router.id}`);
            return {
                success: true,
                message: `UniFi controller reachable at ${host}:${port}`,
                details: { host, port },
            };
        }
        catch (error) {
            return {
                success: false,
                message: `UniFi connection test failed: ${error.message}`,
            };
        }
    }
    async createHotspotUser(_router, _params) {
        throw new Error('Method not implemented: UniFi createHotspotUser');
    }
    async removeHotspotUser(_router, _username) {
        throw new Error('Method not implemented: UniFi removeHotspotUser');
    }
    async disconnectUser(_router, _sessionId) {
        throw new Error('Method not implemented: UniFi disconnectUser');
    }
    async getActiveSessions(_router) {
        throw new Error('Method not implemented: UniFi getActiveSessions');
    }
    async getRouterStatus(router) {
        this.logger.warn(`UniFi provider cannot get full status for router ${router.id}`);
        return {
            isOnline: false,
            cpuUsage: 0,
            memoryUsage: 0,
            uptime: 0,
            activeSessions: 0,
            version: 'UniFi',
            model: 'UniFi Controller',
        };
    }
    async setBandwidthLimit(_router, _username, _uploadKbps, _downloadKbps) {
        throw new Error('Method not implemented: UniFi setBandwidthLimit');
    }
    async bindMacAddress(_router, _macAddress, _ipAddress) {
        throw new Error('Method not implemented: UniFi bindMacAddress');
    }
    async removeMacBinding(_router, _macAddress) {
        throw new Error('Method not implemented: UniFi removeMacBinding');
    }
    async refreshSession(_router, _sessionId, _newExpiry) {
        throw new Error('Method not implemented: UniFi refreshSession');
    }
};
exports.UnifiProvider = UnifiProvider;
exports.UnifiProvider = UnifiProvider = UnifiProvider_1 = __decorate([
    (0, common_1.Injectable)()
], UnifiProvider);
