Bugfixes
This commit is contained in:
36
Backend/dist/Integrations/IntegrationsManager.js
vendored
36
Backend/dist/Integrations/IntegrationsManager.js
vendored
@@ -1,9 +1,13 @@
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
||||
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
||||
to[j] = from[i];
|
||||
return to;
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.IntegrationsManager = void 0;
|
||||
var path = require("path");
|
||||
var Logger_1 = require("../Logger");
|
||||
@@ -18,7 +22,7 @@ var IntegrationsManager = /** @class */ (function () {
|
||||
}
|
||||
IntegrationsManager.prototype.load = function (callback) {
|
||||
var _this = this;
|
||||
Logger_1.Log('info', 'Loading integrations');
|
||||
(0, Logger_1.Log)('info', 'Loading integrations');
|
||||
ensureDir(path.join(Undecked.dataPath, 'custom_integrations'), function (err) {
|
||||
if (err)
|
||||
throw err;
|
||||
@@ -60,7 +64,7 @@ var IntegrationsManager = /** @class */ (function () {
|
||||
clearInterval(waitInterval);
|
||||
loaded[type]++;
|
||||
loadIntegrations(type, function () {
|
||||
Logger_1.Log('info', "Loaded " + type + " integration '" + integrationID + "'");
|
||||
(0, Logger_1.Log)('info', "Loaded ".concat(type, " integration '").concat(integrationID, "'"));
|
||||
cb();
|
||||
}, i + 1);
|
||||
}
|
||||
@@ -69,7 +73,7 @@ var IntegrationsManager = /** @class */ (function () {
|
||||
if (waitCounter > 200) {
|
||||
clearInterval(waitInterval);
|
||||
delete instance.integrations[integrationID];
|
||||
Logger_1.Log('error', "Unable to load " + type + " integration '" + integrationID + "': Loading timeout");
|
||||
(0, Logger_1.Log)('error', "Unable to load ".concat(type, " integration '").concat(integrationID, "': Loading timeout"));
|
||||
loadIntegrations(type, cb, i + 1);
|
||||
}
|
||||
}
|
||||
@@ -77,7 +81,7 @@ var IntegrationsManager = /** @class */ (function () {
|
||||
}
|
||||
catch (error) {
|
||||
clearInterval(waitInterval);
|
||||
Logger_1.Log('error', "Unable to load " + type + " integration '" + integrationID + "': " + error.message);
|
||||
(0, Logger_1.Log)('error', "Unable to load ".concat(type, " integration '").concat(integrationID, "': ").concat(error.message));
|
||||
loadIntegrations(type, cb, i + 1);
|
||||
}
|
||||
}
|
||||
@@ -112,10 +116,10 @@ var IntegrationsManager = /** @class */ (function () {
|
||||
integration.integration.main(integration.api);
|
||||
}
|
||||
catch (error) {
|
||||
Logger_1.Log('error', "Error in '" + integrationID + "'", error.message, error.stack);
|
||||
(0, Logger_1.Log)('error', "Error in '".concat(integrationID, "'"), error.message, error.stack);
|
||||
}
|
||||
}
|
||||
Logger_1.Log('info', "Loaded " + loaded.buildin + " buildin integrations and " + loaded.custom + " integrations");
|
||||
(0, Logger_1.Log)('info', "Loaded ".concat(loaded.buildin, " buildin integrations and ").concat(loaded.custom, " integrations"));
|
||||
callback();
|
||||
});
|
||||
});
|
||||
@@ -216,13 +220,13 @@ var IntegrationsManager = /** @class */ (function () {
|
||||
return { error: "Key does not exist" };
|
||||
}
|
||||
else
|
||||
return { error: "Page '" + settings.pageID + "' does not exist" };
|
||||
return { error: "Page '".concat(settings.pageID, "' does not exist") };
|
||||
}
|
||||
else
|
||||
return { error: "Action '" + settings.actionID + "' does not exist" };
|
||||
return { error: "Action '".concat(settings.actionID, "' does not exist") };
|
||||
}
|
||||
else
|
||||
return { error: "Integration '" + settings.integrationID + "' does not exist" };
|
||||
return { error: "Integration '".concat(settings.integrationID, "' does not exist") };
|
||||
};
|
||||
IntegrationsManager.prototype.editorExists = function (editorID) {
|
||||
return this.openEditors[editorID] != undefined;
|
||||
@@ -246,7 +250,7 @@ var IntegrationsManager = /** @class */ (function () {
|
||||
actionInstance.logs = [];
|
||||
actionInstance.logs = __spreadArray([
|
||||
{ timestamp: Date.now(), type: type, text: text }
|
||||
], actionInstance.logs);
|
||||
], actionInstance.logs, true);
|
||||
if (actionInstance.logs.length > 20)
|
||||
actionInstance.logs.splice(20, actionInstance.logs.length - 20);
|
||||
// Log(
|
||||
@@ -256,7 +260,7 @@ var IntegrationsManager = /** @class */ (function () {
|
||||
// );
|
||||
}, deck);
|
||||
else
|
||||
Logger_1.Log('warn', "Tried calling non-exisintg handler for action '" + actionInstance.actionID + "' of integration '" + actionInstance.integrationID + "'");
|
||||
(0, Logger_1.Log)('warn', "Tried calling non-exisintg handler for action '".concat(actionInstance.actionID, "' of integration '").concat(actionInstance.integrationID, "'"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user