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