UNPKG

unifi-client

Version:

NodeJs client for Unifi products (https://www.ui.com/)

133 lines (132 loc) 5.67 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.UAPDevice = void 0; var BaseDevice_1 = require("./BaseDevice"); var Validate_1 = require("../commons/Validate"); var EDeviceType_1 = require("./EDeviceType"); var UAPDevice = /** @class */ (function (_super) { __extends(UAPDevice, _super); function UAPDevice() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.type = EDeviceType_1.EDeviceType.UAP; return _this; } UAPDevice.prototype.import = function (props) { _super.prototype.import.call(this, props); if (!Validate_1.Validate.isUndefined(props.x_vwirekey)) { this.xVwirekey = props.x_vwirekey; } if (!Validate_1.Validate.isUndefined(props.vwire_table)) { this.vwireTable = props.vwire_table; } if (!Validate_1.Validate.isUndefined(props.antenna_table)) { this.antennaTable = props.antenna_table; } if (!Validate_1.Validate.isUndefined(props.radio_table)) { this.radioTable = props.radio_table; } if (!Validate_1.Validate.isUndefined(props.scan_radio_table)) { this.scanRadioTable = props.scan_radio_table; } if (!Validate_1.Validate.isUndefined(props.country_code)) { this.countryCode = props.country_code; } if (!Validate_1.Validate.isUndefined(props.countrycode_table)) { this.countrycodeTable = props.countrycode_table; } if (!Validate_1.Validate.isUndefined(props.wlangroup_id_na)) { this.wlangroupIdNa = props.wlangroup_id_na; } if (!Validate_1.Validate.isUndefined(props.wlangroup_id_ng)) { this.wlangroupIdNg = props.wlangroup_id_ng; } if (!Validate_1.Validate.isUndefined(props.acc_meter_stats)) { this.accMeterStats = props.acc_meter_stats; } if (!Validate_1.Validate.isUndefined(props.supports_fingerprint_ml)) { this.supportsFingerprintMl = props.supports_fingerprint_ml; } if (!Validate_1.Validate.isUndefined(props.disconnection_reason)) { this.disconnectionReason = props.disconnection_reason; } if (!Validate_1.Validate.isUndefined(props.scanning)) { this.scanning = props.scanning; } if (!Validate_1.Validate.isUndefined(props.spectrum_scanning)) { this.spectrumScanning = props.spectrum_scanning; } if (!Validate_1.Validate.isUndefined(props.meshv3_peer_mac)) { this.meshv3PeerMAC = props.meshv3_peer_mac; } if (!Validate_1.Validate.isUndefined(props.element_peer_mac)) { this.elementPeerMAC = props.element_peer_mac; } if (!Validate_1.Validate.isUndefined(props.hide_ch_width)) { this.hideChWidth = props.hide_ch_width; } if (!Validate_1.Validate.isUndefined(props.isolated)) { this.isolated = props.isolated; } if (!Validate_1.Validate.isUndefined(props.radio_table_stats)) { this.radioTableStats = props.radio_table_stats; } if (!Validate_1.Validate.isUndefined(props.port_stats)) { this.portStats = props.port_stats; } if (!Validate_1.Validate.isUndefined(props.vap_table)) { this.vapTable = props.vap_table; } if (!Validate_1.Validate.isUndefined(props.vwire_vap_table)) { this.vwireVapTable = props.vwire_vap_table; } if (!Validate_1.Validate.isUndefined(props['bytes-d'])) { this.bytesD = props['bytes-d']; } if (!Validate_1.Validate.isUndefined(props['tx_bytes-d'])) { this.txBytesD = props['tx_bytes-d']; } if (!Validate_1.Validate.isUndefined(props['rx_bytes-d'])) { this.rxBytesD = props['rx_bytes-d']; } if (!Validate_1.Validate.isUndefined(props['bytes-r'])) { this.bytesR = props['bytes-r']; } if (!Validate_1.Validate.isUndefined(props.last_scan)) { this.lastScan = props.last_scan; } if (!Validate_1.Validate.isUndefined(props.vwireEnabled)) { this.vwireEnabled = props.vwireEnabled; } if (!Validate_1.Validate.isUndefined(props.uplink_table)) { this.uplinkTable = props.uplink_table; } return this; }; UAPDevice.prototype.updateDevice = function (payload) { return this._updateDevice(payload); }; UAPDevice.prototype.enable = function (enable) { if (enable === void 0) { enable = true; } return this.updateDevice({ disabled: !enable }); }; UAPDevice.type = EDeviceType_1.EDeviceType.UAP; return UAPDevice; }(BaseDevice_1.BaseDevice)); exports.UAPDevice = UAPDevice;