formatLanDevice.js 1.0 KB

123456789101112131415161718192021222324
  1. "use strict";
  2. var __importDefault = (this && this.__importDefault) || function (mod) {
  3. return (mod && mod.__esModule) ? mod : { "default": mod };
  4. };
  5. Object.defineProperty(exports, "__esModule", { value: true });
  6. var lanControlAuthenticationUtils_1 = __importDefault(require("./lanControlAuthenticationUtils"));
  7. exports.default = (function (device) {
  8. var txt = device.txt, a = device.a, srv = device.srv;
  9. var _a = txt.data1, data1 = _a === void 0 ? '' : _a, _b = txt.data2, data2 = _b === void 0 ? '' : _b, _c = txt.data3, data3 = _c === void 0 ? '' : _c, _d = txt.data4, data4 = _d === void 0 ? '' : _d;
  10. try {
  11. return {
  12. deviceId: txt.id,
  13. type: txt.type,
  14. encryptedData: "".concat(data1).concat(data2).concat(data3).concat(data4),
  15. ip: a,
  16. port: srv.port,
  17. target: srv.target,
  18. iv: lanControlAuthenticationUtils_1.default.decryptionBase64(txt.iv),
  19. };
  20. }
  21. catch (error) {
  22. return null;
  23. }
  24. });