diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d7ce887..eab671e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,4 +17,4 @@ jobs: uses: joelwmale/webhook-action@749e2dcbc6735ce0c36e1dbbb660618cd7b5f91c env: WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }} - data: "{'text': '[GITHUB] New release in sphinx-relay! ${{ env.HEAD_TAG }}', 'action': 'broadcast', 'app': 'github', 'secret': '${{ secrets.WEBHOOK_SECRET }}', 'chat_uuid': 'XzsnzB-numfWNUcTXGkEkoMKCt4k36C2t60a-zohJTWrL--vHjia2WQ11gwbwdAtnsYTT3fyzRhH2YF7KqiOxwnGVlkd'}" \ No newline at end of file + data: "{'text': '[GITHUB] New release in sphinx-relay! ${{ env.HEAD_TAG }}', 'action': 'broadcast', 'bot_id': '87B4FDD3DD71C2B0', 'bot_secret': '${{ secrets.WEBHOOK_SECRET }}'}" \ No newline at end of file diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 0aba5da..5b97474 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -19,4 +19,4 @@ jobs: uses: joelwmale/webhook-action@749e2dcbc6735ce0c36e1dbbb660618cd7b5f91c env: WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }} - data: "{'text': 'New push in sphinx-relay by ${{ env.COMMIT_AUTHOR }}: ${{ env.COMMIT_MSG }}', 'action': 'broadcast', 'app': 'github', 'secret': '${{ secrets.WEBHOOK_SECRET }}', 'chat_uuid': 'XzsnzB-numfWNUcTXGkEkoMKCt4k36C2t60a-zohJTWrL--vHjia2WQ11gwbwdAtnsYTT3fyzRhH2YF7KqiOxwnGVlkd'}" \ No newline at end of file + data: "{'text': 'New push in sphinx-relay by ${{ env.COMMIT_AUTHOR }}: ${{ env.COMMIT_MSG }}', 'action': 'broadcast', 'bot_id': '87B4FDD3DD71C2B0', 'bot_secret': '${{ secrets.WEBHOOK_SECRET }}'}" \ No newline at end of file diff --git a/api/controllers/actions.ts b/api/controllers/actions.ts index d715fa9..45bcfe4 100644 --- a/api/controllers/actions.ts +++ b/api/controllers/actions.ts @@ -1,62 +1,84 @@ import { success, failure } from '../utils/res' import * as path from 'path' -import * as fs from 'fs' import * as network from '../network' import { models } from '../models' import * as short from 'short-uuid' import * as rsa from '../crypto/rsa' +import * as crypto from 'crypto' +import * as jsonUtils from '../utils/json' /* +hexdump -n 8 -e '4/4 "%08X" 1 "\n"' /dev/random hexdump -n 16 -e '4/4 "%08X" 1 "\n"' /dev/random */ -const actionFile = '../../../actions.json' -const constants = require(path.join(__dirname,'../../config/constants.json')) +const constants = require(path.join(__dirname, '../../config/constants.json')) -export async function doAction(req, res) { - const thePath = path.join(__dirname,actionFile) +export const getBots = async (req, res) => { try { - if (fs.existsSync(thePath)) { - processExtra(req, res) - } else { - failure(res, 'no file') - } - } catch(err) { - console.error(err) - failure(res, 'fail') + const bots = await models.Bot.findAll() + success(res, { + bots: bots.map(b=> jsonUtils.botToJson(b)) + }) + } catch(e) { + failure(res,'no bots') + } +} + +export const createBot = async (req, res) => { + const { chat_id, name, } = req.body + + const newBot = { + id: crypto.randomBytes(8).toString('hex').toUpperCase(), + chatId: chat_id, + name: name, + secret: crypto.randomBytes(16).toString('hex').toUpperCase() + } + try { + const theBot = await models.Bot.create(newBot) + success(res, jsonUtils.botToJson(theBot)) + } catch (e) { + failure(res, 'bot creation failed') } } -async function processExtra(req, res) { - const actions = require(path.join(__dirname,actionFile)) - if(!(actions&&actions.length)) { - return failure(res, 'no actions defined') +export const deleteBot = async (req, res) => { + const id = req.params.id + if (!id) return + try { + models.Bot.destroy({ where: { id } }) + success(res, true) + } catch (e) { + console.log('ERROR deleteBot', e) + failure(res, e) } +} + +export async function processAction(req, res) { let body = req.body - if(body.data && typeof body.data==='string' && body.data[1]==="'") { + if (body.data && typeof body.data === 'string' && body.data[1] === "'") { try { // parse out body from "data" for github webhook action - const dataBody = JSON.parse(body.data.replace(/'/g,'"')) - if(dataBody) body=dataBody - } catch(e) { + const dataBody = JSON.parse(body.data.replace(/'/g, '"')) + if (dataBody) body = dataBody + } catch (e) { console.log(e) return failure(res, 'failed to parse webhook body json') } } - const {action,app,secret,pubkey,amount,chat_uuid,text} = body - - const theApp = actions.find(a=>a.app===app) - if(!theApp) { - return failure(res, 'app not found') - } - if(!(theApp.secret&&theApp.secret===secret)) { + const { action, bot_id, bot_secret, pubkey, amount, text } = body + const bot = await models.Bot.findOne({ where: { id: bot_id } }) + if (!bot) return failure(res, 'no bot') + + if (!(bot.secret && bot.secret === bot_secret)) { return failure(res, 'wrong secret') } - if(!action){ + if (!action) { return failure(res, 'no action') } - if(action==='keysend') { - if(!(pubkey&&pubkey.length===66&&amount)) { + if (action === 'keysend') { + console.log('=> BOT KEYSEND') + if (!(pubkey && pubkey.length === 66 && amount)) { return failure(res, 'wrong params') } const MIN_SATS = 3 @@ -64,33 +86,34 @@ async function processExtra(req, res) { const opts = { dest: destkey, data: {}, - amt: Math.max((amount||0), MIN_SATS) + amt: Math.max((amount || 0), MIN_SATS) } try { await network.signAndSend(opts) - return success(res, {success:true}) - } catch(e) { + return success(res, { success: true }) + } catch (e) { return failure(res, e) } - } else if (action==='broadcast') { - if(!chat_uuid || !text) return failure(res,'no uuid or text') + } else if (action === 'broadcast') { + console.log('=> BOT BROADCAST') + if (!bot.chatId || !text) return failure(res, 'no uuid or text') const owner = await models.Contact.findOne({ where: { isOwner: true } }) - const theChat = await models.Chat.findOne({where:{uuid: chat_uuid}}) - if(!theChat || !owner) return failure(res,'no chat') - if(!theChat.type===constants.chat_types.tribe) return failure(res,'not a tribe') - + const theChat = await models.Chat.findOne({ where: { id: bot.chatId } }) + if (!theChat || !owner) return failure(res, 'no chat') + if (!theChat.type === constants.chat_types.tribe) return failure(res, 'not a tribe') + const encryptedForMeText = rsa.encrypt(owner.contactKey, text) const encryptedText = rsa.encrypt(theChat.groupKey, text) - const textMap = {'chat': encryptedText} + const textMap = { 'chat': encryptedText } var date = new Date(); date.setMilliseconds(0) - const alias = app.charAt(0).toUpperCase() + app.slice(1); - const msg:{[k:string]:any}={ + const alias = bot.name || 'Bot' + const msg: { [k: string]: any } = { chatId: theChat.id, uuid: short.generate(), type: constants.message_types.message, sender: owner.id, - amount: amount||0, + amount: amount || 0, date: date, messageContent: encryptedForMeText, remoteMessageContent: JSON.stringify(textMap), @@ -102,11 +125,11 @@ async function processExtra(req, res) { const message = await models.Message.create(msg) await network.sendMessage({ chat: theChat, - sender: {...owner.dataValues, alias}, - message: { content:textMap, id:message.id, uuid: message.uuid }, + sender: { ...owner.dataValues, alias }, + message: { content: textMap, id: message.id, uuid: message.uuid }, type: constants.message_types.message, - success: ()=> success(res, {success:true}), - failure: ()=> failure(res, 'failed'), + success: () => success(res, { success: true }), + failure: () => failure(res, 'failed'), }) } else { return failure(res, 'no action') diff --git a/api/controllers/index.ts b/api/controllers/index.ts index 9045875..bddfacd 100644 --- a/api/controllers/index.ts +++ b/api/controllers/index.ts @@ -93,7 +93,10 @@ export async function set(app) { app.get('/logs', details.getLogsSince) app.get('/info', details.getNodeInfo) - app.post('/action', actions.doAction) + app.post('/action', actions.processAction) + app.get('/bots', actions.getBots) + app.post('/bot', actions.createBot) + app.delete('/bot/:id', actions.deleteBot) app.get('/version', async function(req,res) { const version = await checkTag() diff --git a/api/models/index.ts b/api/models/index.ts index 189d7ae..1fb77ba 100644 --- a/api/models/index.ts +++ b/api/models/index.ts @@ -8,6 +8,7 @@ import Subscription from './ts/subscription' import MediaKey from './ts/mediaKey' import ChatMember from './ts/chatMember' import Timer from './ts/timer' +import Bot from './ts/bot' const env = process.env.NODE_ENV || 'development'; const config = require(path.join(__dirname,'../../config/config.json'))[env] @@ -15,7 +16,7 @@ const config = require(path.join(__dirname,'../../config/config.json'))[env] const sequelize = new Sequelize({ ...config, logging: process.env.SQL_LOG==='true' ? console.log : false, - models: [Chat,Contact,Invite,Message,Subscription,MediaKey,ChatMember,Timer] + models: [Chat,Contact,Invite,Message,Subscription,MediaKey,ChatMember,Timer,Bot] }) const models = sequelize.models diff --git a/api/models/ts/bot.ts b/api/models/ts/bot.ts new file mode 100644 index 0000000..841a8c6 --- /dev/null +++ b/api/models/ts/bot.ts @@ -0,0 +1,28 @@ +import { Table, Column, Model, DataType } from 'sequelize-typescript'; + +@Table({tableName: 'sphinx_bots', underscored: true}) +export default class Bot extends Model { + + @Column({ + type: DataType.TEXT, + primaryKey: true, + unique: true, + }) + id: string + + @Column(DataType.BIGINT) + chatId: number + + @Column + name: string + + @Column + secret: string + + @Column + createdAt: Date + + @Column + updatedAt: Date + +} \ No newline at end of file diff --git a/api/utils/json.ts b/api/utils/json.ts index 73ea6a8..2746fa6 100644 --- a/api/utils/json.ts +++ b/api/utils/json.ts @@ -38,6 +38,8 @@ function contactToJson(contact){ const inviteToJson = (invite) => toSnake(invite.dataValues||invite) +const botToJson = (bot) => toSnake(bot.dataValues||bot) + const jsonToContact = (json) => toCamel(json) function subscriptionToJson(subscription, chat) { @@ -58,4 +60,5 @@ export { jsonToContact, chatToJson, subscriptionToJson, + botToJson, } diff --git a/api/utils/setup.ts b/api/utils/setup.ts index b46f6e0..824d511 100644 --- a/api/utils/setup.ts +++ b/api/utils/setup.ts @@ -31,6 +31,19 @@ async function setVersion(){ } async function migrate(){ + + try{ + await sequelize.query(` + CREATE TABLE sphinx_bots ( + id TEXT NOT NULL PRIMARY KEY, + name TEXT, + chat_id BIGINT, + secret TEXT, + created_at DATETIME, + updated_at DATETIME + )`) + } catch(e){} + addTableColumn('sphinx_chats', 'app_url') try{ diff --git a/dist/api/controllers/actions.js b/dist/api/controllers/actions.js index 9e7867d..74c2af9 100644 --- a/dist/api/controllers/actions.js +++ b/dist/api/controllers/actions.js @@ -11,40 +11,59 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", { value: true }); const res_1 = require("../utils/res"); const path = require("path"); -const fs = require("fs"); const network = require("../network"); const models_1 = require("../models"); const short = require("short-uuid"); const rsa = require("../crypto/rsa"); +const crypto = require("crypto"); +const jsonUtils = require("../utils/json"); /* +hexdump -n 8 -e '4/4 "%08X" 1 "\n"' /dev/random hexdump -n 16 -e '4/4 "%08X" 1 "\n"' /dev/random */ -const actionFile = '../../../actions.json'; const constants = require(path.join(__dirname, '../../config/constants.json')); -function doAction(req, res) { +exports.getBots = (req, res) => __awaiter(void 0, void 0, void 0, function* () { + try { + const bots = yield models_1.models.Bot.findAll(); + res_1.success(res, { + bots: bots.map(b => jsonUtils.botToJson(b)) + }); + } + catch (e) { + res_1.failure(res, 'no bots'); + } +}); +exports.createBot = (req, res) => __awaiter(void 0, void 0, void 0, function* () { + const { chat_id, name, } = req.body; + const newBot = { + id: crypto.randomBytes(8).toString('hex').toUpperCase(), + chatId: chat_id, + name: name, + secret: crypto.randomBytes(16).toString('hex').toUpperCase() + }; + try { + const theBot = yield models_1.models.Bot.create(newBot); + res_1.success(res, jsonUtils.botToJson(theBot)); + } + catch (e) { + res_1.failure(res, 'bot creation failed'); + } +}); +exports.deleteBot = (req, res) => __awaiter(void 0, void 0, void 0, function* () { + const id = req.params.id; + if (!id) + return; + try { + models_1.models.Bot.destroy({ where: { id } }); + res_1.success(res, true); + } + catch (e) { + console.log('ERROR deleteBot', e); + res_1.failure(res, e); + } +}); +function processAction(req, res) { return __awaiter(this, void 0, void 0, function* () { - const thePath = path.join(__dirname, actionFile); - try { - if (fs.existsSync(thePath)) { - processExtra(req, res); - } - else { - res_1.failure(res, 'no file'); - } - } - catch (err) { - console.error(err); - res_1.failure(res, 'fail'); - } - }); -} -exports.doAction = doAction; -function processExtra(req, res) { - return __awaiter(this, void 0, void 0, function* () { - const actions = require(path.join(__dirname, actionFile)); - if (!(actions && actions.length)) { - return res_1.failure(res, 'no actions defined'); - } let body = req.body; if (body.data && typeof body.data === 'string' && body.data[1] === "'") { try { // parse out body from "data" for github webhook action @@ -57,18 +76,18 @@ function processExtra(req, res) { return res_1.failure(res, 'failed to parse webhook body json'); } } - const { action, app, secret, pubkey, amount, chat_uuid, text } = body; - const theApp = actions.find(a => a.app === app); - if (!theApp) { - return res_1.failure(res, 'app not found'); - } - if (!(theApp.secret && theApp.secret === secret)) { + const { action, bot_id, bot_secret, pubkey, amount, text } = body; + const bot = yield models_1.models.Bot.findOne({ where: { id: bot_id } }); + if (!bot) + return res_1.failure(res, 'no bot'); + if (!(bot.secret && bot.secret === bot_secret)) { return res_1.failure(res, 'wrong secret'); } if (!action) { return res_1.failure(res, 'no action'); } if (action === 'keysend') { + console.log('=> BOT KEYSEND'); if (!(pubkey && pubkey.length === 66 && amount)) { return res_1.failure(res, 'wrong params'); } @@ -88,10 +107,11 @@ function processExtra(req, res) { } } else if (action === 'broadcast') { - if (!chat_uuid || !text) + console.log('=> BOT BROADCAST'); + if (!bot.chatId || !text) return res_1.failure(res, 'no uuid or text'); const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } }); - const theChat = yield models_1.models.Chat.findOne({ where: { uuid: chat_uuid } }); + const theChat = yield models_1.models.Chat.findOne({ where: { id: bot.chatId } }); if (!theChat || !owner) return res_1.failure(res, 'no chat'); if (!theChat.type === constants.chat_types.tribe) @@ -101,7 +121,7 @@ function processExtra(req, res) { const textMap = { 'chat': encryptedText }; var date = new Date(); date.setMilliseconds(0); - const alias = app.charAt(0).toUpperCase() + app.slice(1); + const alias = bot.name || 'Bot'; const msg = { chatId: theChat.id, uuid: short.generate(), @@ -131,4 +151,5 @@ function processExtra(req, res) { } }); } +exports.processAction = processAction; //# sourceMappingURL=actions.js.map \ No newline at end of file diff --git a/dist/api/controllers/actions.js.map b/dist/api/controllers/actions.js.map index 5cb02c9..39cdd23 100644 --- a/dist/api/controllers/actions.js.map +++ b/dist/api/controllers/actions.js.map @@ -1 +1 @@ -{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../api/controllers/actions.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAA+C;AAC/C,6BAA4B;AAC5B,yBAAwB;AACxB,sCAAqC;AACrC,sCAA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,CAAC,EAAE;gBAClB,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE;gBACtB,IAAI,EAAE,SAAS,CAAC,aAAa,CAAC,OAAO;gBACrC,MAAM,EAAE,KAAK,CAAC,EAAE;gBAChB,MAAM,EAAE,MAAM,IAAI,CAAC;gBACnB,IAAI,EAAE,IAAI;gBACV,cAAc,EAAE,kBAAkB;gBAClC,oBAAoB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;gBAC7C,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS;gBACpC,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,IAAI;gBACf,WAAW,EAAE,KAAK;aACrB,CAAA;YACD,MAAM,OAAO,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YAChD,MAAM,OAAO,CAAC,WAAW,CAAC;gBACtB,IAAI,EAAE,OAAO;gBACb,MAAM,kCAAO,KAAK,CAAC,UAAU,KAAE,KAAK,GAAE;gBACtC,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE;gBACjE,IAAI,EAAE,SAAS,CAAC,aAAa,CAAC,OAAO;gBACrC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAO,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gBAC9C,OAAO,EAAE,GAAG,EAAE,CAAC,aAAO,CAAC,GAAG,EAAE,QAAQ,CAAC;aACxC,CAAC,CAAA;SACL;aAAM;YACH,OAAO,aAAO,CAAC,GAAG,EAAE,WAAW,CAAC,CAAA;SACnC;IACL,CAAC;CAAA;AAhFD,sCAgFC"} \ No newline at end of file diff --git a/dist/api/controllers/index.js b/dist/api/controllers/index.js index 421d84b..a2b462b 100644 --- a/dist/api/controllers/index.js +++ b/dist/api/controllers/index.js @@ -90,7 +90,10 @@ function set(app) { app.get('/getinfo', details.getInfo); app.get('/logs', details.getLogsSince); app.get('/info', details.getNodeInfo); - app.post('/action', actions.doAction); + app.post('/action', actions.processAction); + app.get('/bots', actions.getBots); + app.post('/bot', actions.createBot); + app.delete('/bot/:id', actions.deleteBot); app.get('/version', function (req, res) { return __awaiter(this, void 0, void 0, function* () { const version = yield gitinfo_1.checkTag(); diff --git a/dist/api/controllers/index.js.map b/dist/api/controllers/index.js.map index 6b22090..6c72731 100644 --- a/dist/api/controllers/index.js.map +++ b/dist/api/controllers/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,iCAAgC;AAChC,2CAA0C;AAC1C,qCAAoC;AACpC,uCAAsC;AACtC,qCAAoC;AACpC,uCAAsC;AACtC,iCAAgC;AAChC,uCAAsC;AACtC,sCAAqC;AACrC,gDAA+C;AAC/C,qCAAoC;AACpC,iDAAgD;AAChD,qCAAoC;AACpC,8CAAyC;AACzC,6BAA4B;AAC5B,0CAAyC;AAGzC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,OAAO,CAAC,GAAG,CAAC,SAAS,EAAC,GAAG,CAAC,CAAA;AAC1B,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,CAAA;AAE7E,SAAsB,GAAG,CAAC,GAAG;;QAE5B,IAAG,eAAM,IAAI,eAAM,CAAC,YAAY,EAAC;YAChC,YAAY,CAAC,kBAAkB,EAAE,CAAA;SACjC;QACD,IAAG;YACF,MAAM,KAAK,CAAC,eAAe,EAAE,CAAA;SAC7B;QAAC,OAAM,CAAC,EAAE;YACV,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;SAC7D;QAED,MAAM,CAAC,YAAY,EAAE,CAAA;Q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,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,UAAU,CAAC,mBAAmB;CACxD,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,iCAAgC;AAChC,2CAA0C;AAC1C,qCAAoC;AACpC,uCAAsC;AACtC,qCAAoC;AACpC,uCAAsC;AACtC,iCAAgC;AAChC,uCAAsC;AACtC,sCAAqC;AACrC,gDAA+C;AAC/C,qCAAoC;AACpC,iDAAgD;AAChD,qCAAoC;AACpC,8CAAyC;AACzC,6BAA4B;AAC5B,0CAAyC;AAGzC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,OAAO,CAAC,GAAG,CAAC,SAAS,EAAC,GAAG,CAAC,CAAA;AAC1B,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,CAAA;AAE7E,SAAsB,GAAG,CAAC,GAAG;;QAE5B,IAAG,eAAM,IAAI,eAAM,CAAC,YAAY,EAAC;YAChC,YAAY,CAAC,kBAAkB,EAAE,CAAA;SACjC;QACD,IAAG;YACF,MAAM,KAAK,CAAC,eAAe,EAAE,CAAA;SAC7B;QAAC,OAAM,CAAC,EAAE;YACV,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;SAC7D;QAED,MAAM,CAAC,YAAY,EAAE,CAAA;QAErB,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,EAA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CAAC,mBAAmB;CACxD,CAAA"} \ No newline at end of file diff --git a/dist/api/models/index.js b/dist/api/models/index.js index 65a8cb1..f8d24ee 100644 --- a/dist/api/models/index.js +++ b/dist/api/models/index.js @@ -10,9 +10,10 @@ const subscription_1 = require("./ts/subscription"); const mediaKey_1 = require("./ts/mediaKey"); const chatMember_1 = require("./ts/chatMember"); const timer_1 = require("./ts/timer"); +const bot_1 = require("./ts/bot"); const env = process.env.NODE_ENV || 'development'; const config = require(path.join(__dirname, '../../config/config.json'))[env]; -const sequelize = new sequelize_typescript_1.Sequelize(Object.assign(Object.assign({}, config), { logging: process.env.SQL_LOG === 'true' ? console.log : false, models: [chat_1.default, contact_1.default, invite_1.default, message_1.default, subscription_1.default, mediaKey_1.default, chatMember_1.default, timer_1.default] })); +const sequelize = new sequelize_typescript_1.Sequelize(Object.assign(Object.assign({}, config), { logging: process.env.SQL_LOG === 'true' ? console.log : false, models: [chat_1.default, contact_1.default, invite_1.default, message_1.default, subscription_1.default, mediaKey_1.default, chatMember_1.default, timer_1.default, bot_1.default] })); exports.sequelize = sequelize; const models = sequelize.models; exports.models = models; diff --git a/dist/api/models/index.js.map b/dist/api/models/index.js.map index 901599f..6fb3284 100644 --- a/dist/api/models/index.js.map +++ b/dist/api/models/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/models/index.ts"],"names":[],"mappings":";;AAAA,+DAA+C;AAC/C,6BAA4B;AAC5B,oCAA4B;AAC5B,0CAAkC;AAClC,wCAAgC;AAChC,0CAAkC;AAClC,oDAA4C;AAC5C,4CAAoC;AACpC,gDAAwC;AACxC,sCAA8B;AAE9B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,0BAA0B,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE5E,MAAM,SAAS,GAAG,IAAI,gCAAS,iCAC1B,MAAM,KACT,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,KAAG,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAC3D,MAAM,EAAE,CAAC,cAAI,EAAC,iBAAO,EAAC,gBAAM,EAAC,iBAAO,EAAC,sBAAY,EAAC,kBAAQ,EAAC,oBAAU,EAAC,eAAK,CAAC,IAC5E,CAAA;AAIA,8BAAS;AAHX,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAA;AAI7B,wBAAM"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/models/index.ts"],"names":[],"mappings":";;AAAA,+DAA+C;AAC/C,6BAA4B;AAC5B,oCAA4B;AAC5B,0CAAkC;AAClC,wCAAgC;AAChC,0CAAkC;AAClC,oDAA4C;AAC5C,4CAAoC;AACpC,gDAAwC;AACxC,sCAA8B;AAC9B,kCAA0B;AAE1B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,0BAA0B,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE5E,MAAM,SAAS,GAAG,IAAI,gCAAS,iCAC1B,MAAM,KACT,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,KAAG,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAC3D,MAAM,EAAE,CAAC,cAAI,EAAC,iBAAO,EAAC,gBAAM,EAAC,iBAAO,EAAC,sBAAY,EAAC,kBAAQ,EAAC,oBAAU,EAAC,eAAK,EAAC,aAAG,CAAC,IAChF,CAAA;AAIA,8BAAS;AAHX,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAA;AAI7B,wBAAM"} \ No newline at end of file diff --git a/dist/api/models/ts/bot.js b/dist/api/models/ts/bot.js new file mode 100644 index 0000000..23c56e6 --- /dev/null +++ b/dist/api/models/ts/bot.js @@ -0,0 +1,47 @@ +"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 Bot = class Bot extends sequelize_typescript_1.Model { +}; +__decorate([ + sequelize_typescript_1.Column({ + type: sequelize_typescript_1.DataType.TEXT, + primaryKey: true, + unique: true, + }), + __metadata("design:type", String) +], Bot.prototype, "id", void 0); +__decorate([ + sequelize_typescript_1.Column(sequelize_typescript_1.DataType.BIGINT), + __metadata("design:type", Number) +], Bot.prototype, "chatId", void 0); +__decorate([ + sequelize_typescript_1.Column, + __metadata("design:type", String) +], Bot.prototype, "name", void 0); +__decorate([ + sequelize_typescript_1.Column, + __metadata("design:type", String) +], Bot.prototype, "secret", void 0); +__decorate([ + sequelize_typescript_1.Column, + __metadata("design:type", Date) +], Bot.prototype, "createdAt", void 0); +__decorate([ + sequelize_typescript_1.Column, + __metadata("design:type", Date) +], Bot.prototype, "updatedAt", void 0); +Bot = __decorate([ + sequelize_typescript_1.Table({ tableName: 'sphinx_bots', underscored: true }) +], Bot); +exports.default = Bot; +//# sourceMappingURL=bot.js.map \ No newline at end of file diff --git a/dist/api/models/ts/bot.js.map b/dist/api/models/ts/bot.js.map new file mode 100644 index 0000000..6278f0a --- /dev/null +++ b/dist/api/models/ts/bot.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bot.js","sourceRoot":"","sources":["../../../../api/models/ts/bot.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAsE;AAGtE,IAAqB,GAAG,GAAxB,MAAqB,GAAI,SAAQ,4BAAU;CAwB1C,CAAA;AAjBC;IALC,6BAAM,CAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,IAAI;QACnB,UAAU,EAAE,IAAI;QAChB,MAAM,EAAE,IAAI;KACb,CAAC;;+BACQ;AAGV;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;mCACV;AAGd;IADC,6BAAM;;iCACK;AAGZ;IADC,6BAAM;;mCACO;AAGd;IADC,6BAAM;8BACI,IAAI;sCAAA;AAGf;IADC,6BAAM;8BACI,IAAI;sCAAA;AAtBI,GAAG;IADvB,4BAAK,CAAC,EAAC,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,IAAI,EAAC,CAAC;GAChC,GAAG,CAwBvB;kBAxBoB,GAAG"} \ No newline at end of file diff --git a/dist/api/utils/json.js b/dist/api/utils/json.js index cfb74d9..98f2617 100644 --- a/dist/api/utils/json.js +++ b/dist/api/utils/json.js @@ -34,6 +34,8 @@ function contactToJson(contact) { exports.contactToJson = contactToJson; const inviteToJson = (invite) => case_1.toSnake(invite.dataValues || invite); exports.inviteToJson = inviteToJson; +const botToJson = (bot) => case_1.toSnake(bot.dataValues || bot); +exports.botToJson = botToJson; const jsonToContact = (json) => case_1.toCamel(json); exports.jsonToContact = jsonToContact; function subscriptionToJson(subscription, chat) { diff --git a/dist/api/utils/json.js.map b/dist/api/utils/json.js.map index 9e861a1..ff273dc 100644 --- a/dist/api/utils/json.js.map +++ b/dist/api/utils/json.js.map @@ -1 +1 @@ -{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../api/utils/json.ts"],"names":[],"mappings":";;AAAA,wCAA6C;AAC7C,oCAAmC;AAEnC,SAAS,UAAU,CA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AG,CAAC,CAAA;AAsBrD,8BAAS;AApBX,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,cAAO,CAAC,IAAI,CAAC,CAAA;AAiB3C,sCAAa;AAff,SAAS,kBAAkB,CAAC,YAAY,EAAE,IAAI;IAC5C,MAAM,GAAG,GAAG,YAAY,CAAC,UAAU,IAAI,YAAY,CAAA;IACnD,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IACpD,OAAO,cAAO,iCACT,GAAG,KACN,QAAQ;QACR,IAAI,EACJ,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IACpC,CAAA;AACJ,CAAC;AAQC,gDAAkB"} \ No newline at end of file diff --git a/dist/api/utils/setup.js b/dist/api/utils/setup.js index 7ed20c2..684ac46 100644 --- a/dist/api/utils/setup.js +++ b/dist/api/utils/setup.js @@ -44,6 +44,18 @@ function setVersion() { } function migrate() { return __awaiter(this, void 0, void 0, function* () { + try { + yield models_1.sequelize.query(` + CREATE TABLE sphinx_bots ( + id TEXT NOT NULL PRIMARY KEY, + name TEXT, + chat_id BIGINT, + secret TEXT, + created_at DATETIME, + updated_at DATETIME + )`); + } + catch (e) { } addTableColumn('sphinx_chats', 'app_url'); try { yield models_1.sequelize.query(`CREATE UNIQUE INDEX chat_member_index ON sphinx_chat_members(chat_id, contact_id);`); diff --git a/dist/api/utils/setup.js.map b/dist/api/utils/setup.js.map index febcc99..98d53e2 100644 --- a/dist/api/utils/setup.js.map +++ b/dist/api/utils/setup.js.map @@ -1 +1 @@ -{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../api/utils/setup.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2CAA2C;AAC3C,sCAA2C;AAC3C,iDAAoC;AACpC,iCAAgC;AAChC,sCAAqC;AACrC,gDAAwC;AACxC,8CAA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