This commit is contained in:
2023-08-29 20:06:52 +02:00
parent 7c2eec4446
commit 25702c073a
225 changed files with 1071 additions and 808 deletions

View File

@@ -1,4 +1,4 @@
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConnectionManager = void 0;
var path = require("path");
var fs_1 = require("fs");
@@ -19,7 +19,7 @@ var ConnectionManager = /** @class */ (function () {
integration_count++;
device_count = device_count + Object.keys(_this_1.connections[integrationID]).length;
}
Logger_1.Log('info', "Loaded " + device_count + " device(s) across " + integration_count + " integration(s)");
(0, Logger_1.Log)('info', "Loaded ".concat(device_count, " device(s) across ").concat(integration_count, " integration(s)"));
callback();
});
};
@@ -38,9 +38,9 @@ var ConnectionManager = /** @class */ (function () {
for (var connectionID in _this_1.connections[integrationID][connectionType]) {
var connection = _this_1.connections[integrationID][connectionType][connectionID];
_this_1.validate(integrationID, connectionType, connectionID, connection.properties, function (valid, error) {
Logger_1.Log(valid ? 'info' : 'warn', valid
? "Loaded " + connectionType + " '" + connection.name + "' from '" + integrationID + "'"
: "Unable to load " + connectionType + " '" + connection.name + "' from '" + integrationID + "'");
(0, Logger_1.Log)(valid ? 'info' : 'warn', valid
? "Loaded ".concat(connectionType, " '").concat(connection.name, "' from '").concat(integrationID, "'")
: "Unable to load ".concat(connectionType, " '").concat(connection.name, "' from '").concat(integrationID, "'"));
});
}
callback();
@@ -73,9 +73,9 @@ var ConnectionManager = /** @class */ (function () {
for (var connectionID in toSave.connections[integrationID][connectionType])
if (toSave.connections[integrationID][connectionType][connectionID].instance != undefined)
delete toSave.connections[integrationID][connectionType][connectionID].instance;
fs_1.writeFile(this.managerConfigPath, JSON.stringify(toSave, null, 4), function (err) {
(0, fs_1.writeFile)(this.managerConfigPath, JSON.stringify(toSave, null, 4), function (err) {
if (err)
Logger_1.Log('error', 'Error whilst saving device manager config', err.message);
(0, Logger_1.Log)('error', 'Error whilst saving device manager config', err.message);
if (callback)
callback();
});
@@ -135,7 +135,7 @@ var ConnectionManager = /** @class */ (function () {
validator(connectionValidatorAPI);
}
else
callback(false, "No validator found for connection type " + connectionType);
callback(false, "No validator found for connection type ".concat(connectionType));
}
};
ConnectionManager.prototype.getConnectionRequestData = function (integrationID, connectionType) {