diff --git a/dist/src/builtin/index.js b/dist/src/builtin/index.js index a1b4c7cd2..523141ad9 100644 --- a/dist/src/builtin/index.js +++ b/dist/src/builtin/index.js @@ -20,6 +20,7 @@ const CallRecordingBot = require("./callRecording"); const GitBot = require("./git"); const bots_1 = require("../controllers/bots"); Object.defineProperty(exports, "buildBotPayload", { enumerable: true, get: function () { return bots_1.buildBotPayload; } }); +const SearchBot = require("./search"); function init() { return __awaiter(this, void 0, void 0, function* () { MotherBot.init(); @@ -28,6 +29,7 @@ function init() { GitBot.init(); BadgeBot.init(); CallRecordingBot.init(); + SearchBot.init(); }); } exports.init = init; diff --git a/dist/src/builtin/index.js.map b/dist/src/builtin/index.js.map index bd8ff587b..9287af701 100644 --- a/dist/src/builtin/index.js.map +++ b/dist/src/builtin/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/builtin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAmD;AACnD,wCAAuC;AACvC,sCAAqC;AACrC,wCAAuC;AACvC,kCAAiC;AACjC,oCAAmC;AACnC,oDAAmD;AAEnD,gCAA+B;AAC/B,8CAAqD;AAiBtB,gGAjBtB,sBAAe,OAiBsB;AAf9C,SAAe,IAAI;;QACjB,SAAS,CAAC,IAAI,EAAE,CAAA;QAChB,UAAU,CAAC,IAAI,EAAE,CAAA;QACjB,OAAO,CAAC,IAAI,EAAE,CAAA;QACd,MAAM,CAAC,IAAI,EAAE,CAAA;QACb,QAAQ,CAAC,IAAI,EAAE,CAAA;QACf,gBAAgB,CAAC,IAAI,EAAE,CAAA;IACzB,CAAC;CAAA;AAQQ,oBAAI;AANb,SAAS,cAAc,CAAC,GAAW,EAAE,SAAkB;IACrD,UAAU,CAAC,GAAG,EAAE;QACd,SAAS,CAAC,KAAK,CAAC,SAAS,EAAE,IAAA,sBAAe,EAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAA;IAC7D,CAAC,EAAE,IAAI,CAAC,CAAA;AACV,CAAC;AAEc,wCAAc"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/builtin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAmD;AACnD,wCAAuC;AACvC,sCAAqC;AACrC,wCAAuC;AACvC,kCAAiC;AACjC,oCAAmC;AACnC,oDAAmD;AAEnD,gCAA+B;AAC/B,8CAAqD;AAmBtB,gGAnBtB,sBAAe,OAmBsB;AAlB9C,sCAAqC;AAErC,SAAe,IAAI;;QACjB,SAAS,CAAC,IAAI,EAAE,CAAA;QAChB,UAAU,CAAC,IAAI,EAAE,CAAA;QACjB,OAAO,CAAC,IAAI,EAAE,CAAA;QACd,MAAM,CAAC,IAAI,EAAE,CAAA;QACb,QAAQ,CAAC,IAAI,EAAE,CAAA;QACf,gBAAgB,CAAC,IAAI,EAAE,CAAA;QACvB,SAAS,CAAC,IAAI,EAAE,CAAA;IAClB,CAAC;CAAA;AAQQ,oBAAI;AANb,SAAS,cAAc,CAAC,GAAW,EAAE,SAAkB;IACrD,UAAU,CAAC,GAAG,EAAE;QACd,SAAS,CAAC,KAAK,CAAC,SAAS,EAAE,IAAA,sBAAe,EAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAA;IAC7D,CAAC,EAAE,IAAI,CAAC,CAAA;AACV,CAAC;AAEc,wCAAc"} \ No newline at end of file diff --git a/dist/src/builtin/mother.js b/dist/src/builtin/mother.js index e9493eb0c..3cfe6fb08 100644 --- a/dist/src/builtin/mother.js +++ b/dist/src/builtin/mother.js @@ -24,7 +24,14 @@ const logger_1 = require("../utils/logger"); const git_1 = require("./git"); const msg_types = Sphinx.MSG_TYPE; const config = (0, config_1.loadConfig)(); -const builtinBots = ['welcome', 'loopout', 'git', 'badge', 'callRecording']; +const builtinBots = [ + 'welcome', + 'loopout', + 'git', + 'badge', + 'callRecording', + 'search', +]; // else just message type const builtInBotMsgTypes = { welcome: [ @@ -43,6 +50,7 @@ const builtInBotNames = { git: 'GitBot', badge: 'BadgeBot', callRecording: 'CallRecordingBot', + search: 'SearchBot', }; function init() { const client = new Sphinx.Client(); diff --git a/dist/src/builtin/mother.js.map b/dist/src/builtin/mother.js.map index 816e283aa..72fd7b849 100644 --- a/dist/src/builtin/mother.js.map +++ b/dist/src/builtin/mother.js.map @@ -1 +1 @@ -{"version":3,"file":"mother.js","sourceRoot":"","sources":["../../../src/builtin/mother.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;AAEd,mDAAmD;AACnD,qCAAoC;AACpC,kDAAmD;AACnD,8CAA4D;AAC5D,sCAAkC;AAClC,2CAA8B;AAC9B,4CAAoC;AACpC,4CAA4C;AAC5C,4CAA0D;AAC1D,4CAA8C;AAC9C,+BAAsD;AAEtD,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAA;AAEjC,MAAM,MAAM,GAAG,IAAA,mBAAU,GAAE,CAAA;AAE3B,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,CAAC,CAAA;AAE3E,yBAAyB;AACzB,MAAM,kBAAkB,GAAG;IACzB,OAAO,EAAE;QACP,mBAAS,CAAC,aAAa,CAAC,OAAO;QAC/B,mBAAS,CAAC,aAAa,CAAC,UAAU;KACnC;IACD,KAAK,EAAE;QACL,mBAAS,CAAC,aAAa,CAAC,OAAO;QAC/B,mBAAS,CAAC,aAAa,CAAC,KAAK;QAC7B,mBAAS,CAAC,aAAa,CAAC,cAAc;KACvC;CACF,CAAA;AAED,MAAM,eAAe,GAAG;IACtB,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,SAAS;IAClB,GAAG,EAAE,QAAQ;IACb,KAAK,EAAE,UAAU;IACjB,aAAa,EAAE,kBAAkB;CAClC,CAAA;AAED,SAAgB,IAAI;IAClB,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,CAAA;IAClC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,oBAAW,CAAC,CAAA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AAE,QAAQ,GAAG,MAAM,CAAA;YAC7C,MAAM,CAAC,GAAG,MAAM,IAAA,oBAAK,EAAC,GAAG,QAAQ,MAAM,MAAM,CAAC,WAAW,QAAQ,IAAI,EAAE,CAAC,CAAA;YACxE,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;YACxB,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,YAAY,EAAE;gBACjC,OAAO,CAAC,CAAA;aACT;YACD,OAAO,IAAI,CAAA;SACZ;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,IAAI,CAAA;SACZ;IACH,CAAC;CAAA"} \ No newline at end of file diff --git a/dist/src/builtin/search.js b/dist/src/builtin/search.js new file mode 100644 index 000000000..b9b671eb1 --- /dev/null +++ b/dist/src/builtin/search.js @@ -0,0 +1,145 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.settleLsat = exports.init = void 0; +const Sphinx = require("sphinx-bot"); +const logger_1 = require("../utils/logger"); +const botapi_1 = require("../controllers/botapi"); +const models_1 = require("../models"); +const node_fetch_1 = require("node-fetch"); +const config_1 = require("../utils/config"); +const graphSubscription_1 = require("../utils/graphSubscription"); +const msg_types = Sphinx.MSG_TYPE; +let initted = false; +const config = (0, config_1.loadConfig)(); +function init() { + if (initted) + return; + initted = true; + const client = new Sphinx.Client(); + client.login('_', botapi_1.finalAction); + client.on(msg_types.MESSAGE, (message) => __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c, _d; + if (!message.content) + return; + const arr = message.content.split(' '); + if (arr.length < 3) + return; + if (arr[0] !== '/search') + return; + const cmd = arr[1]; + try { + const tribe = (yield models_1.models.Chat.findOne({ + where: { uuid: message.channel.id }, + })); + switch (cmd) { + case 'search': + const graphs = yield (0, graphSubscription_1.graphQuery)(tribe.id); + const searchWord = `${arr.slice(1, arr.length).join(' ')}`; + const subscriptions = yield settleLsat(graphs, searchWord); + const request = { + company_name: 'Sphinx', + tribe_name: tribe.name, + search_word: searchWord, + subscriptions, + }; + const response = yield (0, node_fetch_1.default)(`${config.private_graph}/prediction/query`, { + method: 'POST', + body: JSON.stringify(request), + headers: { + 'Content-Type': 'application/json', + }, + }); + if (response.ok) { + const parsedRes = yield response.json(); + let internalRes = []; + if ((_a = parsedRes.internal) === null || _a === void 0 ? void 0 : _a.exact) { + internalRes = (_b = parsedRes.internal) === null || _b === void 0 ? void 0 : _b.exact.slice(0, 5); + } + let externalRes = []; + if ((_c = parsedRes.external) === null || _c === void 0 ? void 0 : _c.exact) { + externalRes = (_d = parsedRes.external) === null || _d === void 0 ? void 0 : _d.exact.slice(0, 5); + } + let returnMsg = ''; + for (let i = 0; i < internalRes.length; i++) { + const result = internalRes[i]; + returnMsg = `${returnMsg} ${result === null || result === void 0 ? void 0 : result.description} from ${result === null || result === void 0 ? void 0 : result.show_title} \n`; + } + for (let i = 0; i < externalRes.length; i++) { + const result = externalRes[i]; + returnMsg = `${returnMsg} ${result.description} from ${result.show_title} \n`; + } + if (!returnMsg) { + returnMsg = 'No result found for your search'; + } + const resEmbed = new Sphinx.MessageEmbed() + .setAuthor('SearchBot') + .setDescription(returnMsg); + message.channel.send({ embed: resEmbed }); + return; + } + else { + const resEmbed = new Sphinx.MessageEmbed() + .setAuthor('SearchBot') + .setDescription(`Sorry seems there is an issue with your internal private graph ${response.status}`); + message.channel.send({ embed: resEmbed }); + return; + } + case 'graph': + if (arr.length !== 4) + return; + const name = arr[2]; + const address = arr[3]; + const graph = (yield models_1.models.GraphSubscription.create({ + name, + address, + status: 1, + tenant: message.member.id, + })); + yield models_1.models.GraphSubscriptionChat.create({ + chatId: tribe.id, + subscriptionId: graph.id, + }); + const resEmbed = new Sphinx.MessageEmbed() + .setAuthor('SearchBot') + .setDescription(`Graph Subscription was added successfully`); + message.channel.send({ embed: resEmbed }); + return; + } + } + catch (error) { + logger_1.sphinxLogger.error(`SEARCH BOT ERROR ${error}`, logger_1.logging.Bots); + } + })); +} +exports.init = init; +function settleLsat(graphs, word) { + return __awaiter(this, void 0, void 0, function* () { + const newGraphs = []; + for (let i = 0; i < graphs.length; i++) { + const graph = graphs[i]; + // const lsat = (await models.Lsat.findOne({ + // where: { paths: graph.address, status: 1 }, + // })) as Lsat + const obj = { + client_name: graph.name, + prediction_endpoint: `${graph.address}?word=${word}`, + //Correct Implementation + // lsat: lsat ? `LSAT ${lsat.macaroon}:${lsat.preimage}` : '', + lsat: `LSAT AgEba25vd2xlZGdlLWdyYXBoLnNwaGlueC5jaGF0AoQBMDAwMGMzN2QzNjI0NTM3YmVkY2UxZThmYTdmM2Y5ZmVkNDYyMTU2MWJiMmJmODY2YWMzYjMzZmM1NDVjNmY3NjE3NzFhZWU5YmZlYzljOTRhMDI2MDU5ZWZlMzk2MTllNDVkY2Q1YWQ5OWI1Y2JjZDA4MzdlNDUzMjM5OGNiMmQyNjFiAAAGIIB-8uA1VZ5gb1rNaRjjFPfBqlF16JnnQd1fK-VuwebL:cb8779ec0e386c62acc88c409f0730707e643e306678b15018676177c7d336f9`, + }; + newGraphs.push(obj); + } + return newGraphs; + }); +} +exports.settleLsat = settleLsat; +//# sourceMappingURL=search.js.map \ No newline at end of file diff --git a/dist/src/builtin/search.js.map b/dist/src/builtin/search.js.map new file mode 100644 index 000000000..ee52fe0d5 --- /dev/null +++ b/dist/src/builtin/search.js.map @@ -0,0 +1 @@ +{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/builtin/search.ts"],"names":[],"mappings":";;;;;;;;;;;;AA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file diff --git a/dist/src/controllers/graphSubscription.js b/dist/src/controllers/graphSubscription.js new file mode 100644 index 000000000..85c3e1768 --- /dev/null +++ b/dist/src/controllers/graphSubscription.js @@ -0,0 +1,142 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getGraphSubscriptionForTribe = exports.getGraphSubscription = exports.addGraphSubscription = void 0; +const models_1 = require("../models"); +const res_1 = require("../utils/res"); +const logger_1 = require("../utils/logger"); +const graphSubscription_1 = require("../utils/graphSubscription"); +function addGraphSubscription(req, res) { + return __awaiter(this, void 0, void 0, function* () { + if (!req.owner) + return (0, res_1.failure)(res, 'no owner'); + const tenant = req.owner.id; + const owner = req.owner; + logger_1.sphinxLogger.info(`=> saveGraphSubscription`, logger_1.logging.Express); + const { name, address, weight, status } = req.body; + let { chatIds } = req.body; + if (!name || !address || !weight) { + return (0, res_1.failure)(res, 'Missing required Graph Subscription data'); + } + if (typeof status !== 'number' || status > 1) { + return (0, res_1.failure)(res, 'Provide valid graph status'); + } + if (chatIds !== 'all' && !Array.isArray(chatIds)) { + return (0, res_1.failure)(res, 'Provide valid tribe Id'); + } + try { + const graph = (yield models_1.models.GraphSubscription.create({ + name, + address, + weight, + status, + tenant, + })); + if (Array.isArray(chatIds)) { + for (let i = 0; i < chatIds.length; i++) { + const chatId = Number(chatIds[i]); + if (!isNaN(chatId)) { + const chat = (yield models_1.models.Chat.findOne({ + where: { id: chatId }, + })); + if (chat && chat.ownerPubkey === owner.publicKey) { + yield models_1.models.GraphSubscriptionChat.create({ + chatId: chat.id, + subscriptionId: graph.id, + }); + } + } + } + } + else if (chatIds === 'all') { + const chats = (yield models_1.models.Chat.findAll({ + where: { ownerPubkey: owner.publicKey }, + })); + for (let i = 0; i < chats.length; i++) { + const chat = chats[i]; + yield models_1.models.GraphSubscriptionChat.create({ + chatId: chat.id, + subscriptionId: graph.id, + }); + } + } + return (0, res_1.success)(res, 'Graph Subscription added successfully'); + } + catch (error) { + logger_1.sphinxLogger.error(`=> saveGraphSubscription error: ${error}`, logger_1.logging.Express); + return (0, res_1.failure)(res, 'An internal error occured'); + } + }); +} +exports.addGraphSubscription = addGraphSubscription; +function getGraphSubscription(req, res) { + return __awaiter(this, void 0, void 0, function* () { + if (!req.owner) + return (0, res_1.failure)(res, 'no owner'); + try { + const graphs = (yield models_1.models.GraphSubscription.findAll()); + const newGraphs = []; + for (let i = 0; i < graphs.length; i++) { + const graph = graphs[i]; + const lsat = (yield models_1.models.Lsat.findOne({ + where: { paths: graph.address, status: 1 }, + })); + const obj = { + client_name: graph.name, + prediction_endpoint: graph.address, + lsat: lsat ? `${lsat.macaroon}:${lsat.preimage}` : '', + }; + newGraphs.push(obj); + } + return (0, res_1.success)(res, newGraphs); + } + catch (error) { + logger_1.sphinxLogger.error(`=> getGraphSubscription error: ${error}`, logger_1.logging.Express); + return (0, res_1.failure)(res, 'An internal error occured'); + } + }); +} +exports.getGraphSubscription = getGraphSubscription; +function getGraphSubscriptionForTribe(req, res) { + return __awaiter(this, void 0, void 0, function* () { + if (!req.owner) + return (0, res_1.failure)(res, 'no owner'); + const { id } = req.params; + if (!id) + return (0, res_1.failure)(res, 'Provide valid tribe id'); + try { + // const tribe = await models.Chat.findOne({ where: { id: tribeId } }) + const tribe = (yield models_1.models.Chat.findOne({ + where: { id }, + })); + if (!tribe) + return (0, res_1.failure)(res, 'Tribe does not exist'); + const results = yield (0, graphSubscription_1.graphQuery)(id); + const finalRes = []; + for (let i = 0; i < results.length; i++) { + const result = results[i]; + const obj = { + name: result.name, + address: result.address, + weight: result.weight, + }; + finalRes.push(obj); + } + return (0, res_1.success)(res, finalRes); + } + catch (error) { + logger_1.sphinxLogger.error(`=> getGraphSubscriptionForTribe error: ${error}`, logger_1.logging.Express); + return (0, res_1.failure)(res, 'An internal error occured'); + } + }); +} +exports.getGraphSubscriptionForTribe = getGraphSubscriptionForTribe; +//# sourceMappingURL=graphSubscription.js.map \ No newline at end of file diff --git a/dist/src/controllers/graphSubscription.js.map b/dist/src/controllers/graphSubscription.js.map new file mode 100644 index 000000000..3fb505a82 --- /dev/null +++ b/dist/src/controllers/graphSubscription.js.map @@ -0,0 +1 @@ +{"version":3,"file":"graphSubscription.js","sourceRoot":"","sources":["../../../src/controllers/graphSubscription.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sCAA6E;AAG7E,sCAA+C;AAC/C,4CAAuD;AACvD,kEAAuD;AAEvD,SAAsB,oBAAoB,CACxC,GAAQ,EACR,GAAa;;QAEb,IAAI,CAAC,GAAG,CAAC,KAAK;YAAE,OAAO,IAAA,aAAO,EAAC,GAAG,EAAE,UAAU,CAAC,CAAA;QAC/C,MAAM,MAAM,GAAW,GAAG,CAAC,KAAK,CAAC,EAAE,CAAA;QACnC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAA;QAEvB,qBAAY,CAAC,IAAI,CAAC,0BAA0B,EAAE,gBAAO,CAAC,OAAO,CAAC,CAAA;QAE9D,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,IAAI,CAAA;QAClD,IAAI,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC,IAAI,CAAA;QAC1B,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,MAAM,EAAE;YAChC,OAAO,IAAA,aAAO,EAAC,GAAG,EAAE,0CAA0C,CAAC,CAAA;SAChE;QAED,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,GAAG,CAA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CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACvC,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;gBACzB,MAAM,GAAG,GAAG;oBACV,IAAI,EAAE,MAAM,CAAC,IAAI;oBACjB,OAAO,EAAE,MAAM,CAAC,OAAO;oBACvB,MAAM,EAAE,MAAM,CAAC,MAAM;iBACtB,CAAA;gBACD,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;aACnB;YACD,OAAO,IAAA,aAAO,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;SAC9B;QAAC,OAAO,KAAK,EAAE;YACd,qBAAY,CAAC,KAAK,CAChB,0CAA0C,KAAK,EAAE,EACjD,gBAAO,CAAC,OAAO,CAChB,CAAA;YACD,OAAO,IAAA,aAAO,EAAC,GAAG,EAAE,2BAA2B,CAAC,CAAA;SACjD;IACH,CAAC;CAAA;AAhCD,oEAgCC"} \ No newline at end of file diff --git a/dist/src/controllers/index.js b/dist/src/controllers/index.js index be213429a..cd9fc1626 100644 --- a/dist/src/controllers/index.js +++ b/dist/src/controllers/index.js @@ -38,6 +38,7 @@ const personal = require("./api/personal"); const lsats = require("./lsats"); const action = require("./actionHistory"); const feeds = require("./getFeeds"); +const graphSubscription = require("./graphSubscription"); function set(app) { return __awaiter(this, void 0, void 0, function* () { builtInBots.init(); @@ -173,6 +174,10 @@ function set(app) { app.get('/active_lsat', lsats.getActiveLsat); // Get feeds app.get('/feeds', feeds.getFeeds); + // Graph Subscription + app.post('/addGraph', graphSubscription.addGraphSubscription); + app.get('/getGraph', graphSubscription.getGraphSubscription); + app.get('/getGraphTribe/:id', graphSubscription.getGraphSubscriptionForTribe); }); } exports.set = set; diff --git a/dist/src/controllers/index.js.map b/dist/src/controllers/index.js.map index 47ed29306..a1b793c82 100644 --- a/dist/src/controllers/index.js.map +++ b/dist/src/controllers/index.js.map @@ -1 +1 @@ -{"version":3,"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,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,YAAY;IACvC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY;IACtC,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,oBAAoB;CACxD,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sCAA2C;AAC3C,iCAAgC;AAChC,2CAA0C;AAC1C,+BAA8B;AAC9B,qCAAoC;AACpC,uCAAsC;AACtC,qCAAoC;AACpC,uCAAsC;AACtC,iCAAgC;AAChC,uCAAsC;AACtC,sCAAqC;AACrC,gDAA+C;AAC/C,qCAAoC;AACpC,iDAAgD;AAChD,oCAAmC;AACnC,qCAAoC;AACpC,4CAA2C;AAC3C,0CAAyC;AACzC,0CAAyC;AACzC,iCAAgC;AAChC,4CAAoC;AACpC,+BAA8B;AAC9B,sCAAsC;AACtC,+BAA8B;AAC9B,2CAA0C;AAC1C,iCAAgC;AAEhC,0CAAyC;AACzC,oCAAmC;AACnC,yDAAwD;AAExD,SAAsB,GAAG,CAAC,GAAG;;QAC3B,WAAW,CAAC,IAAI,EAAE,CAAA;QAElB,IAAI,eAAM,IAAI,eAAM,CAAC,YAAY,EAAE;YACjC,YAAY,CAAC,kBAAkB,EAAE,CAAA;SAClC;QAED,0BAA0B;QAE1B,MAAM,CAAC,YAAY,EAAE,CAAA;QAErB,gCAAgC;QAEhC,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;QACjC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;QACzC,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;QACvC,GAAG,CAAC,IAAI,CAAC,8BAA8B,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;QACpD,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AAoB;IAC1D,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,UAAU,CAAC,mBAAmB;IACxD,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,UAAU,CAAC,kBAAkB;IACtD,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,iBAAiB;IAC9C,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa;IACtC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa;IACtC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,gBAAgB;IACpD,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,aAAa,CAAC,4BAA4B;IAC7E,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,YAAY;IACvC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY;IACtC,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,oBAAoB;CACxD,CAAA"} \ No newline at end of file diff --git a/dist/src/models/index.js b/dist/src/models/index.js index f9d26f255..f95bc6483 100644 --- a/dist/src/models/index.js +++ b/dist/src/models/index.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.CallRecording = exports.ActionHistory = exports.RequestsTransportTokens = exports.BotMember = exports.Lsat = exports.MediaKey = exports.Accounting = exports.Bot = exports.Timer = exports.ChatBot = exports.Subscription = exports.Invite = exports.ChatMember = exports.Message = exports.Chat = exports.Contact = exports.models = exports.sequelize = void 0; +exports.GraphSubscriptionChat = exports.GraphSubscription = exports.CallRecording = exports.ActionHistory = exports.RequestsTransportTokens = exports.BotMember = exports.Lsat = exports.MediaKey = exports.Accounting = exports.Bot = exports.Timer = exports.ChatBot = exports.Subscription = exports.Invite = exports.ChatMember = exports.Message = exports.Chat = exports.Contact = exports.models = exports.sequelize = void 0; // parse BIGINTs to number const pg = require("pg"); pg.defaults.parseInt8 = true; @@ -42,6 +42,10 @@ const actionHistory_1 = require("./sql/actionHistory"); exports.ActionHistory = actionHistory_1.default; const callRecording_1 = require("./sql/callRecording"); exports.CallRecording = callRecording_1.default; +const graphSubscription_1 = require("./sql/graphSubscription"); +exports.GraphSubscription = graphSubscription_1.default; +const graphSubscriptionChat_1 = require("./sql/graphSubscriptionChat"); +exports.GraphSubscriptionChat = graphSubscriptionChat_1.default; const argv = minimist(process.argv.slice(2)); const configFile = argv.db ? path.resolve(process.cwd(), argv.db) @@ -77,6 +81,8 @@ const opts = Object.assign(Object.assign({}, config), { logging: appConfig.sql_l requestsTransportTokens_1.default, actionHistory_1.default, callRecording_1.default, + graphSubscription_1.default, + graphSubscriptionChat_1.default, ] }); if ((0, proxy_1.isProxy)()) { opts.pool = { diff --git a/dist/src/models/index.js.map b/dist/src/models/index.js.map index b2eff424b..e99fb7d98 100644 --- a/dist/src/models/index.js.map +++ b/dist/src/models/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":";;;AAAA,0BAA0B;AAC1B,yBAAwB;AACxB,EAAE,CAAC,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAA;AAC5B,+DAAgD;AAChD,6BAA4B;AAC5B,qCAA6C;AAkF3C,eAlFK,cAAI,CAkFL;AAjFN,2CAAsD;AA+EpD,kBA/EK,iBAAO,CA+EL;AA9ET,yCAAmD;AA2FjD,iBA3FK,gBAAM,CA2FL;AA1FR,2CAAsD;AAiFpD,kBAjFK,iBAAO,CAiFL;AAhFT,qDAA6C;AA0F3C,uBA1FK,sBAAY,CA0FL;AAzFd,6CAAyD;AA+FvD,mBA/FK,kBAAQ,CA+FL;AA9FV,iDAA+D;AAkF7D,qBAlFK,oBAAU,CAkFL;AAjFZ,uCAA+B;AAyF7B,gBAzFK,eAAK,CAyFL;AAxFP,mCAA0C;AAyFxC,cAzFK,aAAG,CAyFL;AAxFL,2CAAsD;AA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,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAC3D,MAAM,EAAE;QACN,cAAI;QACJ,iBAAO;QACP,gBAAM;QACN,iBAAO;QACP,sBAAY;QACZ,kBAAQ;QACR,oBAAU;QACV,eAAK;QACL,aAAG;QACH,iBAAO;QACP,mBAAS;QACT,oBAAU;QACV,cAAI;QACJ,iCAAuB;QACvB,uBAAa;QACb,uBAAa;KACd,GACF,CAAA;AACD,IAAI,IAAA,eAAO,GAAE,EAAE;IACb,IAAI,CAAC,IAAI,GAAG;QACV,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,KAAK;KACZ,CAAA;CACF;AAED,MAAM,SAAS,GAAG,IAAI,gCAAS,CAAC,IAAI,CAAC,CAAA;AAInC,8BAAS;AAHX,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAA;AAI7B,wBAAM"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":";;;AAAA,0BAA0B;AAC1B,yBAAwB;AACxB,EAAE,CAAC,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAA;AAC5B,+DAAgD;AAChD,6BAA4B;AAC5B,qCAA6C;AA0F3C,eA1FK,cAAI,CA0FL;AAzFN,2CAAsD;AAuFpD,kBAvFK,iBAAO,CAuFL;AAtFT,yCAAmD;AAmGjD,iBAnGK,gBAAM,CAmGL;AAlGR,2CAAsD;AAyFpD,kBAzFK,iBAAO,CAyFL;AAxFT,qDAA6C;AAkG3C,uBAlGK,sBAAY,CAkGL;AAjGd,6CAAyD;AAuGvD,mBAvGK,kBAAQ,CAuGL;AAtGV,iDAA+D;AA0F7D,qBA1FK,oBAAU,CA0FL;AAzFZ,uCAA+B;AAiG7B,gBAjGK,eAAK,CAiGL;AAhGP,mCAA0C;AAiGxC,cAjGK,aAAG,CAiGL;AAh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AA;CAC9D;AAED,MAAM,SAAS,GAAG,IAAA,mBAAU,GAAE,CAAA;AAE9B,MAAM,IAAI,mCACL,MAAM,KACT,OAAO,EAAE,SAAS,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAC3D,MAAM,EAAE;QACN,cAAI;QACJ,iBAAO;QACP,gBAAM;QACN,iBAAO;QACP,sBAAY;QACZ,kBAAQ;QACR,oBAAU;QACV,eAAK;QACL,aAAG;QACH,iBAAO;QACP,mBAAS;QACT,oBAAU;QACV,cAAI;QACJ,iCAAuB;QACvB,uBAAa;QACb,uBAAa;QACb,2BAAiB;QACjB,+BAAqB;KACtB,GACF,CAAA;AACD,IAAI,IAAA,eAAO,GAAE,EAAE;IACb,IAAI,CAAC,IAAI,GAAG;QACV,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,KAAK;KACZ,CAAA;CACF;AAED,MAAM,SAAS,GAAG,IAAI,gCAAS,CAAC,IAAI,CAAC,CAAA;AAInC,8BAAS;AAHX,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAA;AAI7B,wBAAM"} \ No newline at end of file diff --git a/dist/src/models/sql/graphSubscription.js b/dist/src/models/sql/graphSubscription.js new file mode 100644 index 000000000..6d1b961ce --- /dev/null +++ b/dist/src/models/sql/graphSubscription.js @@ -0,0 +1,56 @@ +"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 __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const sequelize_typescript_1 = require("sequelize-typescript"); +let GraphSubscription = class GraphSubscription extends sequelize_typescript_1.Model { +}; +__decorate([ + (0, sequelize_typescript_1.Column)({ + type: sequelize_typescript_1.DataType.BIGINT, + primaryKey: true, + unique: true, + autoIncrement: true, + }), + __metadata("design:type", Number) +], GraphSubscription.prototype, "id", void 0); +__decorate([ + (0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.TEXT), + __metadata("design:type", String) +], GraphSubscription.prototype, "name", void 0); +__decorate([ + sequelize_typescript_1.Column, + __metadata("design:type", String) +], GraphSubscription.prototype, "address", void 0); +__decorate([ + (0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.TEXT), + __metadata("design:type", String) +], GraphSubscription.prototype, "weight", void 0); +__decorate([ + sequelize_typescript_1.Column, + __metadata("design:type", Number) +], GraphSubscription.prototype, "status", void 0); +__decorate([ + sequelize_typescript_1.Column, + __metadata("design:type", Number) +], GraphSubscription.prototype, "tenant", void 0); +__decorate([ + sequelize_typescript_1.Column, + __metadata("design:type", Date) +], GraphSubscription.prototype, "createdAt", void 0); +__decorate([ + sequelize_typescript_1.Column, + __metadata("design:type", Date) +], GraphSubscription.prototype, "updatedAt", void 0); +GraphSubscription = __decorate([ + (0, sequelize_typescript_1.Table)({ tableName: 'sphinx_graph_subscription', underscored: true }) +], GraphSubscription); +exports.default = GraphSubscription; +//# sourceMappingURL=graphSubscription.js.map \ No newline at end of file diff --git a/dist/src/models/sql/graphSubscription.js.map b/dist/src/models/sql/graphSubscription.js.map new file mode 100644 index 000000000..93ae55837 --- /dev/null +++ b/dist/src/models/sql/graphSubscription.js.map @@ -0,0 +1 @@ +{"version":3,"file":"graphSubscription.js","sourceRoot":"","sources":["../../../../src/models/sql/graphSubscription.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAqE;AAGrE,IAAqB,iBAAiB,GAAtC,MAAqB,iBAAkB,SAAQ,4BAAwB;CA8BtE,CAAA;AAvBC;IANC,IAAA,6BAAM,EAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,MAAM;QACrB,UAAU,EAAE,IAAI;QAChB,MAAM,EAAE,IAAI;QACZ,aAAa,EAAE,IAAI;KACpB,CAAC;;6CACQ;AAGV;IADC,IAAA,6BAAM,EAAC,+BAAQ,CAAC,IAAI,CAAC;;+CACV;AAGZ;IADC,6BAAM;;kDACQ;AAGf;IADC,IAAA,6BAAM,EAAC,+BAAQ,CAAC,IAAI,CAAC;;iDACR;AAId;IADC,6BAAM;;iDACO;AAGd;IADC,6BAAM;;iDACO;AAGd;IADC,6BAAM;8BACI,IAAI;oDAAA;AAGf;IADC,6BAAM;8BACI,IAAI;oDAAA;AA7BI,iBAAiB;IADrC,IAAA,4BAAK,EAAC,EAAE,SAAS,EAAE,2BAA2B,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;GAChD,iBAAiB,CA8BrC;kBA9BoB,iBAAiB"} \ No newline at end of file diff --git a/dist/src/models/sql/graphSubscriptionChat.js b/dist/src/models/sql/graphSubscriptionChat.js new file mode 100644 index 000000000..33f0d5758 --- /dev/null +++ b/dist/src/models/sql/graphSubscriptionChat.js @@ -0,0 +1,44 @@ +"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 __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const sequelize_typescript_1 = require("sequelize-typescript"); +let GraphSubscriptionChat = class GraphSubscriptionChat extends sequelize_typescript_1.Model { +}; +__decorate([ + (0, sequelize_typescript_1.Column)({ + type: sequelize_typescript_1.DataType.BIGINT, + primaryKey: true, + unique: true, + autoIncrement: true, + }), + __metadata("design:type", Number) +], GraphSubscriptionChat.prototype, "id", void 0); +__decorate([ + (0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.BIGINT), + __metadata("design:type", Number) +], GraphSubscriptionChat.prototype, "subscriptionId", void 0); +__decorate([ + (0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.BIGINT), + __metadata("design:type", Number) +], GraphSubscriptionChat.prototype, "chatId", void 0); +__decorate([ + sequelize_typescript_1.Column, + __metadata("design:type", Date) +], GraphSubscriptionChat.prototype, "createdAt", void 0); +__decorate([ + sequelize_typescript_1.Column, + __metadata("design:type", Date) +], GraphSubscriptionChat.prototype, "updatedAt", void 0); +GraphSubscriptionChat = __decorate([ + (0, sequelize_typescript_1.Table)({ tableName: 'sphinx_graph_subscription_chat', underscored: true }) +], GraphSubscriptionChat); +exports.default = GraphSubscriptionChat; +//# sourceMappingURL=graphSubscriptionChat.js.map \ No newline at end of file diff --git a/dist/src/models/sql/graphSubscriptionChat.js.map b/dist/src/models/sql/graphSubscriptionChat.js.map new file mode 100644 index 000000000..f687f8dd7 --- /dev/null +++ b/dist/src/models/sql/graphSubscriptionChat.js.map @@ -0,0 +1 @@ +{"version":3,"file":"graphSubscriptionChat.js","sourceRoot":"","sources":["../../../../src/models/sql/graphSubscriptionChat.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAqE;AAGrE,IAAqB,qBAAqB,GAA1C,MAAqB,qBAAsB,SAAQ,4BAA4B;CAoB9E,CAAA;AAbC;IANC,IAAA,6BAAM,EAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,MAAM;QACrB,UAAU,EAAE,IAAI;QAChB,MAAM,EAAE,IAAI;QACZ,aAAa,EAAE,IAAI;KACpB,CAAC;;iDACQ;AAGV;IADC,IAAA,6BAAM,EAAC,+BAAQ,CAAC,MAAM,CAAC;;6DACF;AAGtB;IADC,IAAA,6BAAM,EAAC,+BAAQ,CAAC,MAAM,CAAC;;qDACV;AAGd;IADC,6BAAM;8BACI,IAAI;wDAAA;AAGf;IADC,6BAAM;8BACI,IAAI;wDAAA;AAnBI,qBAAqB;IADzC,IAAA,4BAAK,EAAC,EAAE,SAAS,EAAE,gCAAgC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;GACrD,qBAAqB,CAoBzC;kBApBoB,qBAAqB"} \ No newline at end of file diff --git a/dist/src/utils/config.js b/dist/src/utils/config.js index 45e475d33..6cdfd5059 100644 --- a/dist/src/utils/config.js +++ b/dist/src/utils/config.js @@ -26,6 +26,7 @@ const DEFAULT_TRANSPORT_PUBLIC_KEY_LOCATION = './creds/transportTokenPublicKey.p const DEFAULT_TRANSPORT_PRIVATE_KEY_LOCATION = './creds/transportTokenPrivateKey.pem'; const DEFAULT_LENGTH_DELAY_FOR_TRANSPORT_TOKEN_DB_CLEARING = 1; const DEFAULT_BOLTWALL_SERVER = 'http://host.docker.internal:8444'; +const DEFAULT_PRIVATE_GRAPH = 'http://3.95.131.14:5000'; function loadConfig() { const logg = ENV.LOGGING || config.logging; const provider = ENV.LIGHTNING_PROVIDER || config.lightning_provider || 'LND'; @@ -108,6 +109,7 @@ function loadConfig() { config.length_of_time_for_transport_token_clear || DEFAULT_LENGTH_DELAY_FOR_TRANSPORT_TOKEN_DB_CLEARING, boltwall_server: config.boltwall_server || DEFAULT_BOLTWALL_SERVER, + private_graph: DEFAULT_PRIVATE_GRAPH, }; } exports.loadConfig = loadConfig; diff --git a/dist/src/utils/config.js.map b/dist/src/utils/config.js.map index 39be81867..acd1f79bc 100644 --- a/dist/src/utils/config.js.map +++ b/dist/src/utils/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/utils/config.ts"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CAAC,OAAO;QACtC,aAAa,EAAE,GAAG,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa;QACxD,2BAA2B,EACzB,GAAG,CAAC,8BAA8B;YAClC,MAAM,CAAC,2BAA2B;YAClC,sCAAsC;QACxC,0BAA0B,EACxB,GAAG,CAAC,6BAA6B;YACjC,MAAM,CAAC,0BAA0B;YACjC,qCAAqC;QACvC,aAAa,EAAE,GAAG,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,IAAI,MAAM;QAClE,wCAAwC,EACtC,GAAG,CAAC,wCAAwC;YAC5C,MAAM,CAAC,wCAAwC;YAC/C,oDAAoD;QACtD,eAAe,EAAE,MAAM,CAAC,eAAe,IAAI,uBAAuB;QAClE,aAAa,EAAE,qBAAqB;KACrC,CAAA;AACH,CAAC;AAvGD,gCAuGC"} \ No newline at end of file diff --git a/dist/src/utils/graphSubscription.js b/dist/src/utils/graphSubscription.js new file mode 100644 index 000000000..7993dafa9 --- /dev/null +++ b/dist/src/utils/graphSubscription.js @@ -0,0 +1,28 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.graphQuery = void 0; +const models_1 = require("../models"); +function graphQuery(id) { + return __awaiter(this, void 0, void 0, function* () { + const results = (yield models_1.sequelize.query(` + SELECT * FROM sphinx_graph_subscription_chat + INNER JOIN sphinx_graph_subscription + ON sphinx_graph_subscription_chat.subscription_id = sphinx_graph_subscription.id + WHERE sphinx_graph_subscription_chat.chat_id = ${id}`, { + model: models_1.models.GraphSubscription, + mapToModel: true, // pass true here if you have any mapped fields + })); + return results; + }); +} +exports.graphQuery = graphQuery; +//# sourceMappingURL=graphSubscription.js.map \ No newline at end of file diff --git a/dist/src/utils/graphSubscription.js.map b/dist/src/utils/graphSubscription.js.map new file mode 100644 index 000000000..9c6de6f67 --- /dev/null +++ b/dist/src/utils/graphSubscription.js.map @@ -0,0 +1 @@ +{"version":3,"file":"graphSubscription.js","sourceRoot":"","sources":["../../../src/utils/graphSubscription.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sCAAsE;AACtE,SAAsB,UAAU,CAAC,EAAE;;QACjC,MAAM,OAAO,GAAG,CAAC,MAAM,kBAAS,CAAC,KAAK,CACpC;;;;uDAImD,EAAE,EAAE,EACvD;YACE,KAAK,EAAE,eAAM,CAAC,iBAAiB;YAC/B,UAAU,EAAE,IAAI,EAAE,+CAA+C;SAClE,CACF,CAA8B,CAAA;QAE/B,OAAO,OAAO,CAAA;IAChB,CAAC;CAAA;AAdD,gCAcC"} \ No newline at end of file diff --git a/dist/src/utils/migrate.js b/dist/src/utils/migrate.js index d73dee39e..dc7aa4de9 100644 --- a/dist/src/utils/migrate.js +++ b/dist/src/utils/migrate.js @@ -280,6 +280,39 @@ function migrate() { catch (e) { // sphinxLogger.error(['problem adding call recording table:', e.message], logging.DB) } + // add graph subscription table + try { + logger_1.sphinxLogger.info('adding graph subscription table', logger_1.logging.DB); + yield models_1.sequelize.query(` + CREATE TABLE sphinx_graph_subscription ( + id BIGINT NOT NULL PRIMARY KEY, + name TEXT, + created_at DATETIME, + updated_at DATETIME, + address TEXT, + weight TEXT, + status INTEGER, + tenant INTEGER + )`); + } + catch (e) { + // sphinxLogger.error(['problem adding graph subscription table:', e.message], logging.DB) + } + // add graph subscription chat table + try { + logger_1.sphinxLogger.info('adding graph subscription chat table', logger_1.logging.DB); + yield models_1.sequelize.query(` + CREATE TABLE sphinx_graph_subscription_chat ( + id BIGINT NOT NULL PRIMARY KEY AUTOINCREMENT, + chat_id BIGINT, + subscription_id BIGINT, + created_at DATETIME, + updated_at DATETIME + )`); + } + catch (e) { + // sphinxLogger.error(['problem adding graph subscription chat table:', e.message], logging.DB) + } }); } exports.default = migrate; diff --git a/dist/src/utils/migrate.js.map b/dist/src/utils/migrate.js.map index 7068c183d..50e28fa64 100644 --- a/dist/src/utils/migrate.js.map +++ b/dist/src/utils/migrate.js.map @@ -1 +1 @@ -{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../../src/utils/migrate.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,wCAAyC;AACzC,sCAAmD;AACnD,qCAAgD;AAChD,4CAAoC;AAEpC,SAAe,YAAY;;QACzB,IAAI;YACF,MAAM,KAAK,GAAG,CAAC,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAW,CAAA;YACrD,IAAI,GAAG,GAAG,KAAK,CAAA;YACf,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;gBAClB,IAAI,CAAC,CAAC,MAAM,KAAK,IAAI,EAAE;oBACrB,GAAG,GAAG,IAAI,CAAA;iBACX;YACH,CAAC,CAAC,CAAA;YACF,IAAI,CAAC,GAAG;gBAAE,OAAM;YAChB,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAA;YACvD,MAAM,IAAA,sBAAY,EAAC,KAAK,EAAE,CAAO,CAAC,EAAE,EAAE;gBACpC,IAAI,CAAC,CAAC,MAAM,KAAK,IAAI,EAAE;oBACrB,MAAM,CAAC,CAAC,MAAM,CAAC;wBACb,MAAM,EAAE,CAAC,CAAC,OAAO;4BACf,CAAC,CAAC,mBAAS,CAAC,aAAa,CAAC,IAAI;4BAC9B,CAAC,CAAC,mBAAS,CAAC,aAAa,CAAC,GAAG;qBAChC,CAAC,CAAA;iBACH;YACH,CAAC,CAAA,CAAC,CAAA;YACF,OAAO,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAA;SACnE;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,GA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cAAc,CAAC,KAAa,EAAE,MAAc,EAAE,IAAI,GAAG,MAAM;;QACxE,IAAI;YACF,MAAM,kBAAS,CAAC,KAAK,CAAC,eAAe,KAAK,QAAQ,MAAM,IAAI,IAAI,EAAE,CAAC,CAAA;SACpE;QAAC,OAAO,CAAC,EAAE;YACV,2DAA2D;SAC5D;IACH,CAAC;CAAA"} \ No newline at end of file +{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../../src/utils/migrate.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,wCAAyC;AACzC,sCAAmD;AACnD,qCAAgD;AAChD,4CAAoC;AAEpC,SAAe,YAAY;;QACzB,IAAI;YACF,MAAM,KAAK,GAAG,CAAC,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAW,CAAA;YACrD,IAAI,GAAG,GAAG,KAAK,CAAA;YACf,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;gBAClB,IAAI,CAAC,CAAC,MAAM,KAAK,IAAI,EAAE;oBACrB,GAAG,GAAG,IAAI,CAAA;iBACX;YACH,CAAC,CAAC,CAAA;YACF,IAAI,CAAC,GAAG;gBAAE,OAAM;YAChB,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAA;YACvD,MAAM,IAAA,sBAAY,EAAC,KAAK,EAAE,CAAO,CAAC,EAAE,EAAE;gBACpC,IAAI,CAAC,CAAC,MAAM,KAAK,IAAI,EAAE;oBACrB,MAAM,CAAC,CAAC,MAAM,CAAC;wBACb,MAAM,EAAE,CAAC,CAAC,OAAO;4BACf,CAAC,CAAC,mBAAS,CAAC,aAAa,CAAC,IAAI;4BAC9B,CAAC,CAAC,mBAAS,CAAC,aAAa,CAAC,GAAG;qBAChC,CAAC,CAAA;iBACH;YACH,CAAC,CAAA,CAAC,CAAA;YACF,OAAO,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAA;SACnE;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,GAAG,CAAC,w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AAC,EAAE,CAAC,CAAA;YACrE,MAAM,kBAAS,CAAC,KAAK,CAAC;;;;;;;MAOpB,CAAC,CAAA;SACJ;QAAC,OAAO,CAAC,EAAE;YACV,+FAA+F;SAChG;IACH,CAAC;CAAA;AA9SD,0BA8SC;AAED,SAAe,SAAS,CAAC,SAAS;;QAChC,MAAM,cAAc,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAA;QACnD,IAAI;YACF,MAAM,kBAAS,CAAC,KAAK,CACnB,UAAU,SAAS,oCAAoC,CACxD,CAAA;SACF;QAAC,OAAO,CAAC,EAAE;YACV,oCAAoC;SACrC;IACH,CAAC;CAAA;AAED,SAAe,cAAc,CAAC,KAAa,EAAE,MAAc,EAAE,IAAI,GAAG,MAAM;;QACxE,IAAI;YACF,MAAM,kBAAS,CAAC,KAAK,CAAC,eAAe,KAAK,QAAQ,MAAM,IAAI,IAAI,EAAE,CAAC,CAAA;SACpE;QAAC,OAAO,CAAC,EAAE;YACV,2DAA2D;SAC5D;IACH,CAAC;CAAA"} \ No newline at end of file diff --git a/src/builtin/index.ts b/src/builtin/index.ts index 821030c95..0d961627c 100644 --- a/src/builtin/index.ts +++ b/src/builtin/index.ts @@ -8,6 +8,7 @@ import * as CallRecordingBot from './callRecording' import { BotMsg } from '../network/interfaces' import * as GitBot from './git' import { buildBotPayload } from '../controllers/bots' +import * as SearchBot from './search' async function init() { MotherBot.init() @@ -16,6 +17,7 @@ async function init() { GitBot.init() BadgeBot.init() CallRecordingBot.init() + SearchBot.init() } function builtinBotEmit(msg: BotMsg, botPrefix?: string) { diff --git a/src/builtin/mother.ts b/src/builtin/mother.ts index 35a8796cd..286ba0329 100644 --- a/src/builtin/mother.ts +++ b/src/builtin/mother.ts @@ -16,7 +16,14 @@ const msg_types = Sphinx.MSG_TYPE const config = loadConfig() -const builtinBots = ['welcome', 'loopout', 'git', 'badge', 'callRecording'] +const builtinBots = [ + 'welcome', + 'loopout', + 'git', + 'badge', + 'callRecording', + 'search', +] // else just message type const builtInBotMsgTypes = { @@ -37,6 +44,7 @@ const builtInBotNames = { git: 'GitBot', badge: 'BadgeBot', callRecording: 'CallRecordingBot', + search: 'SearchBot', } export function init() { diff --git a/src/builtin/search.ts b/src/builtin/search.ts new file mode 100644 index 000000000..020dde637 --- /dev/null +++ b/src/builtin/search.ts @@ -0,0 +1,147 @@ +import * as Sphinx from 'sphinx-bot' +import { sphinxLogger, logging } from '../utils/logger' +import { finalAction } from '../controllers/botapi' +import { models, ChatRecord, GraphSubscriptionRecord } from '../models' +import fetch from 'node-fetch' +import { loadConfig } from '../utils/config' +import { graphQuery } from '../utils/graphSubscription' + +const msg_types = Sphinx.MSG_TYPE + +let initted = false + +interface SearchResult { + description: string + show_title: string +} + +const config = loadConfig() + +export function init() { + if (initted) return + initted = true + + const client = new Sphinx.Client() + client.login('_', finalAction) + + client.on(msg_types.MESSAGE, async (message: Sphinx.Message) => { + if (!message.content) return + const arr = message.content.split(' ') + if (arr.length < 3) return + if (arr[0] !== '/search') return + const cmd = arr[1] + + try { + const tribe = (await models.Chat.findOne({ + where: { uuid: message.channel.id }, + })) as ChatRecord + switch (cmd) { + case 'search': + const graphs = await graphQuery(tribe.id) + const searchWord = `${arr.slice(1, arr.length).join(' ')}` + const subscriptions = await settleLsat(graphs, searchWord) + const request = { + company_name: 'Sphinx', + tribe_name: tribe.name, + search_word: searchWord, + subscriptions, + } + const response = await fetch( + `${config.private_graph}/prediction/query`, + { + method: 'POST', + body: JSON.stringify(request), + headers: { + 'Content-Type': 'application/json', + }, + } + ) + if (response.ok) { + const parsedRes = await response.json() + let internalRes: SearchResult[] = [] + if (parsedRes.internal?.exact) { + internalRes = parsedRes.internal?.exact.slice(0, 5) + } + + let externalRes: SearchResult[] = [] + if (parsedRes.external?.exact) { + externalRes = parsedRes.external?.exact.slice(0, 5) + } + let returnMsg = '' + for (let i = 0; i < internalRes.length; i++) { + const result = internalRes[i] + returnMsg = `${returnMsg} ${result?.description} from ${result?.show_title} \n` + } + for (let i = 0; i < externalRes.length; i++) { + const result = externalRes[i] + returnMsg = `${returnMsg} ${result.description} from ${result.show_title} \n` + } + if (!returnMsg) { + returnMsg = 'No result found for your search' + } + const resEmbed = new Sphinx.MessageEmbed() + .setAuthor('SearchBot') + .setDescription(returnMsg) + message.channel.send({ embed: resEmbed }) + return + } else { + const resEmbed = new Sphinx.MessageEmbed() + .setAuthor('SearchBot') + .setDescription( + `Sorry seems there is an issue with your internal private graph ${response.status}` + ) + message.channel.send({ embed: resEmbed }) + return + } + case 'graph': + if (arr.length !== 4) return + const name = arr[2] + const address = arr[3] + + const graph = (await models.GraphSubscription.create({ + name, + address, + status: 1, + tenant: message.member.id, + })) as GraphSubscriptionRecord + await models.GraphSubscriptionChat.create({ + chatId: tribe.id, + subscriptionId: graph.id, + }) + const resEmbed = new Sphinx.MessageEmbed() + .setAuthor('SearchBot') + .setDescription(`Graph Subscription was added successfully`) + message.channel.send({ embed: resEmbed }) + return + } + } catch (error) { + sphinxLogger.error(`SEARCH BOT ERROR ${error}`, logging.Bots) + } + }) +} + +export async function settleLsat( + graphs: GraphSubscriptionRecord[], + word: string +) { + const newGraphs: { + client_name: string + prediction_endpoint: string + lsat: string + }[] = [] + for (let i = 0; i < graphs.length; i++) { + const graph = graphs[i] + // const lsat = (await models.Lsat.findOne({ + // where: { paths: graph.address, status: 1 }, + // })) as Lsat + const obj = { + client_name: graph.name, + prediction_endpoint: `${graph.address}?word=${word}`, + //Correct Implementation + // lsat: lsat ? `LSAT ${lsat.macaroon}:${lsat.preimage}` : '', + lsat: `LSAT AgEba25vd2xlZGdlLWdyYXBoLnNwaGlueC5jaGF0AoQBMDAwMGMzN2QzNjI0NTM3YmVkY2UxZThmYTdmM2Y5ZmVkNDYyMTU2MWJiMmJmODY2YWMzYjMzZmM1NDVjNmY3NjE3NzFhZWU5YmZlYzljOTRhMDI2MDU5ZWZlMzk2MTllNDVkY2Q1YWQ5OWI1Y2JjZDA4MzdlNDUzMjM5OGNiMmQyNjFiAAAGIIB-8uA1VZ5gb1rNaRjjFPfBqlF16JnnQd1fK-VuwebL:cb8779ec0e386c62acc88c409f0730707e643e306678b15018676177c7d336f9`, + } + newGraphs.push(obj) + } + return newGraphs +} diff --git a/src/controllers/graphSubscription.ts b/src/controllers/graphSubscription.ts new file mode 100644 index 000000000..98c0a56bf --- /dev/null +++ b/src/controllers/graphSubscription.ts @@ -0,0 +1,146 @@ +import { GraphSubscriptionRecord, models, Lsat, ChatRecord } from '../models' +import { Req } from '../types' +import { Response } from 'express' +import { failure, success } from '../utils/res' +import { logging, sphinxLogger } from '../utils/logger' +import { graphQuery } from '../utils/graphSubscription' + +export async function addGraphSubscription( + req: Req, + res: Response +): Promise { + if (!req.owner) return failure(res, 'no owner') + const tenant: number = req.owner.id + const owner = req.owner + + sphinxLogger.info(`=> saveGraphSubscription`, logging.Express) + + const { name, address, weight, status } = req.body + let { chatIds } = req.body + if (!name || !address || !weight) { + return failure(res, 'Missing required Graph Subscription data') + } + + if (typeof status !== 'number' || status > 1) { + return failure(res, 'Provide valid graph status') + } + + if (chatIds !== 'all' && !Array.isArray(chatIds)) { + return failure(res, 'Provide valid tribe Id') + } + + try { + const graph = (await models.GraphSubscription.create({ + name, + address, + weight, + status, + tenant, + })) as GraphSubscriptionRecord + + if (Array.isArray(chatIds)) { + for (let i = 0; i < chatIds.length; i++) { + const chatId = Number(chatIds[i]) + if (!isNaN(chatId)) { + const chat = (await models.Chat.findOne({ + where: { id: chatId }, + })) as ChatRecord + if (chat && chat.ownerPubkey === owner.publicKey) { + await models.GraphSubscriptionChat.create({ + chatId: chat.id, + subscriptionId: graph.id, + }) + } + } + } + } else if (chatIds === 'all') { + const chats = (await models.Chat.findAll({ + where: { ownerPubkey: owner.publicKey }, + })) as ChatRecord[] + for (let i = 0; i < chats.length; i++) { + const chat = chats[i] + await models.GraphSubscriptionChat.create({ + chatId: chat.id, + subscriptionId: graph.id, + }) + } + } + return success(res, 'Graph Subscription added successfully') + } catch (error) { + sphinxLogger.error( + `=> saveGraphSubscription error: ${error}`, + logging.Express + ) + return failure(res, 'An internal error occured') + } +} + +export async function getGraphSubscription( + req: Req, + res: Response +): Promise { + if (!req.owner) return failure(res, 'no owner') + try { + const graphs = + (await models.GraphSubscription.findAll()) as GraphSubscriptionRecord[] + + const newGraphs: { + client_name: string + prediction_endpoint: string + lsat: string + }[] = [] + for (let i = 0; i < graphs.length; i++) { + const graph = graphs[i] + const lsat = (await models.Lsat.findOne({ + where: { paths: graph.address, status: 1 }, + })) as Lsat + const obj = { + client_name: graph.name, + prediction_endpoint: graph.address, + lsat: lsat ? `${lsat.macaroon}:${lsat.preimage}` : '', + } + newGraphs.push(obj) + } + return success(res, newGraphs) + } catch (error) { + sphinxLogger.error( + `=> getGraphSubscription error: ${error}`, + logging.Express + ) + return failure(res, 'An internal error occured') + } +} + +export async function getGraphSubscriptionForTribe( + req: Req, + res: Response +): Promise { + if (!req.owner) return failure(res, 'no owner') + const { id } = req.params + if (!id) return failure(res, 'Provide valid tribe id') + try { + // const tribe = await models.Chat.findOne({ where: { id: tribeId } }) + const tribe = (await models.Chat.findOne({ + where: { id }, + })) as ChatRecord + if (!tribe) return failure(res, 'Tribe does not exist') + const results = await graphQuery(id) + const finalRes: { name: string; address: string; weight: string }[] = [] + for (let i = 0; i < results.length; i++) { + const result = results[i] + const obj = { + name: result.name, + address: result.address, + weight: result.weight, + } + finalRes.push(obj) + } + return success(res, finalRes) + } catch (error) { + sphinxLogger.error( + `=> getGraphSubscriptionForTribe error: ${error}`, + logging.Express + ) + return failure(res, 'An internal error occured') + } +} diff --git a/src/controllers/index.ts b/src/controllers/index.ts index f21c1a2d8..a39367f2e 100644 --- a/src/controllers/index.ts +++ b/src/controllers/index.ts @@ -27,6 +27,7 @@ import * as lsats from './lsats' import { Req } from '../types' import * as action from './actionHistory' import * as feeds from './getFeeds' +import * as graphSubscription from './graphSubscription' export async function set(app) { builtInBots.init() @@ -189,6 +190,11 @@ export async function set(app) { // Get feeds app.get('/feeds', feeds.getFeeds) + + // Graph Subscription + app.post('/addGraph', graphSubscription.addGraphSubscription) + app.get('/getGraph', graphSubscription.getGraphSubscription) + app.get('/getGraphTribe/:id', graphSubscription.getGraphSubscriptionForTribe) } const msgtypes = constants.message_types diff --git a/src/models/index.ts b/src/models/index.ts index d17ad86d5..09444a543 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -23,6 +23,12 @@ import { isProxy } from '../utils/proxy' import { readFileSync } from 'fs' import ActionHistory, { ActionHistoryRecord } from './sql/actionHistory' import CallRecording, { CallRecordingRecord } from './sql/callRecording' +import GraphSubscription, { + GraphSubscriptionRecord, +} from './sql/graphSubscription' +import GraphSubscriptionChat, { + GraphSubscriptionChatRecord, +} from './sql/graphSubscriptionChat' const argv = minimist(process.argv.slice(2)) @@ -66,6 +72,8 @@ const opts = { RequestsTransportTokens, ActionHistory, CallRecording, + GraphSubscription, + GraphSubscriptionChat, ], } if (isProxy()) { @@ -111,4 +119,8 @@ export { ActionHistoryRecord, CallRecording, CallRecordingRecord, + GraphSubscription, + GraphSubscriptionRecord, + GraphSubscriptionChat, + GraphSubscriptionChatRecord, } diff --git a/src/models/sql/graphSubscription.ts b/src/models/sql/graphSubscription.ts new file mode 100644 index 000000000..e5eac1353 --- /dev/null +++ b/src/models/sql/graphSubscription.ts @@ -0,0 +1,38 @@ +import { Table, Column, Model, DataType } from 'sequelize-typescript' + +@Table({ tableName: 'sphinx_graph_subscription', underscored: true }) +export default class GraphSubscription extends Model { + @Column({ + type: DataType.BIGINT, + primaryKey: true, + unique: true, + autoIncrement: true, + }) + id: number + + @Column(DataType.TEXT) + name: string + + @Column + address: string + + @Column(DataType.TEXT) + weight: string + + // This would either be 1 or 0 + @Column + status: number + + @Column + tenant: number + + @Column + createdAt: Date + + @Column + updatedAt: Date +} + +export interface GraphSubscriptionRecord extends GraphSubscription { + dataValues: GraphSubscription +} diff --git a/src/models/sql/graphSubscriptionChat.ts b/src/models/sql/graphSubscriptionChat.ts new file mode 100644 index 000000000..521b267a3 --- /dev/null +++ b/src/models/sql/graphSubscriptionChat.ts @@ -0,0 +1,28 @@ +import { Table, Column, Model, DataType } from 'sequelize-typescript' + +@Table({ tableName: 'sphinx_graph_subscription_chat', underscored: true }) +export default class GraphSubscriptionChat extends Model { + @Column({ + type: DataType.BIGINT, + primaryKey: true, + unique: true, + autoIncrement: true, + }) + id: number + + @Column(DataType.BIGINT) + subscriptionId: number + + @Column(DataType.BIGINT) + chatId: number + + @Column + createdAt: Date + + @Column + updatedAt: Date +} + +export interface GraphSubscriptionChatRecord extends GraphSubscriptionChat { + dataValues: GraphSubscriptionChat +} diff --git a/src/utils/config.ts b/src/utils/config.ts index 0b2701a7d..8c5f3bc2a 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -32,6 +32,7 @@ const DEFAULT_TRANSPORT_PRIVATE_KEY_LOCATION = './creds/transportTokenPrivateKey.pem' const DEFAULT_LENGTH_DELAY_FOR_TRANSPORT_TOKEN_DB_CLEARING = 1 const DEFAULT_BOLTWALL_SERVER = 'http://host.docker.internal:8444' +const DEFAULT_PRIVATE_GRAPH = 'http://3.95.131.14:5000' export function loadConfig() { const logg = ENV.LOGGING || config.logging @@ -134,5 +135,6 @@ export function loadConfig() { config.length_of_time_for_transport_token_clear || DEFAULT_LENGTH_DELAY_FOR_TRANSPORT_TOKEN_DB_CLEARING, boltwall_server: config.boltwall_server || DEFAULT_BOLTWALL_SERVER, + private_graph: DEFAULT_PRIVATE_GRAPH, } } diff --git a/src/utils/graphSubscription.ts b/src/utils/graphSubscription.ts new file mode 100644 index 000000000..f04b2921d --- /dev/null +++ b/src/utils/graphSubscription.ts @@ -0,0 +1,16 @@ +import { GraphSubscriptionRecord, models, sequelize } from '../models' +export async function graphQuery(id) { + const results = (await sequelize.query( + ` + SELECT * FROM sphinx_graph_subscription_chat + INNER JOIN sphinx_graph_subscription + ON sphinx_graph_subscription_chat.subscription_id = sphinx_graph_subscription.id + WHERE sphinx_graph_subscription_chat.chat_id = ${id}`, + { + model: models.GraphSubscription, + mapToModel: true, // pass true here if you have any mapped fields + } + )) as GraphSubscriptionRecord[] + + return results +} diff --git a/src/utils/migrate.ts b/src/utils/migrate.ts index bf39e0cd7..b0c6385dd 100644 --- a/src/utils/migrate.ts +++ b/src/utils/migrate.ts @@ -304,6 +304,39 @@ export default async function migrate(): Promise { } catch (e) { // sphinxLogger.error(['problem adding call recording table:', e.message], logging.DB) } + + // add graph subscription table + try { + sphinxLogger.info('adding graph subscription table', logging.DB) + await sequelize.query(` + CREATE TABLE sphinx_graph_subscription ( + id BIGINT NOT NULL PRIMARY KEY, + name TEXT, + created_at DATETIME, + updated_at DATETIME, + address TEXT, + weight TEXT, + status INTEGER, + tenant INTEGER + )`) + } catch (e) { + // sphinxLogger.error(['problem adding graph subscription table:', e.message], logging.DB) + } + + // add graph subscription chat table + try { + sphinxLogger.info('adding graph subscription chat table', logging.DB) + await sequelize.query(` + CREATE TABLE sphinx_graph_subscription_chat ( + id BIGINT NOT NULL PRIMARY KEY AUTOINCREMENT, + chat_id BIGINT, + subscription_id BIGINT, + created_at DATETIME, + updated_at DATETIME + )`) + } catch (e) { + // sphinxLogger.error(['problem adding graph subscription chat table:', e.message], logging.DB) + } } async function addTenant(tableName) {