Browse Source

bots sql table, model, process action route

push-params
Evan Feenstra 4 years ago
parent
commit
96939e9831
  1. 40
      api/controllers/actions.ts
  2. 2
      api/controllers/index.ts
  3. 3
      api/models/index.ts
  4. 22
      api/models/ts/bot.ts
  5. 11
      api/utils/setup.ts
  6. 45
      dist/api/controllers/actions.js
  7. 2
      dist/api/controllers/actions.js.map
  8. 2
      dist/api/controllers/index.js
  9. 2
      dist/api/controllers/index.js.map
  10. 3
      dist/api/models/index.js
  11. 2
      dist/api/models/index.js.map
  12. 39
      dist/api/models/ts/bot.js
  13. 1
      dist/api/models/ts/bot.js.map
  14. 10
      dist/api/utils/setup.js
  15. 2
      dist/api/utils/setup.js.map

40
api/controllers/actions.ts

@ -1,37 +1,18 @@
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'
/*
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'))
export async function doAction(req, res) {
const thePath = path.join(__dirname,actionFile)
try {
if (fs.existsSync(thePath)) {
processExtra(req, res)
} else {
failure(res, 'no file')
}
} catch(err) {
console.error(err)
failure(res, 'fail')
}
}
async function processExtra(req, res) {
const actions = require(path.join(__dirname,actionFile))
if(!(actions&&actions.length)) {
return failure(res, 'no actions defined')
}
export async function processAction(req, res) {
let body = req.body
if(body.data && typeof body.data==='string' && body.data[1]==="'") {
try { // parse out body from "data" for github webhook action
@ -42,13 +23,12 @@ async function processExtra(req, res) {
return failure(res, 'failed to parse webhook body json')
}
}
const {action,app,secret,pubkey,amount,chat_uuid,text} = body
const {action,bot_id,bot_secret,pubkey,amount,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 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){
@ -73,9 +53,9 @@ async function processExtra(req, res) {
return failure(res, e)
}
} else if (action==='broadcast') {
if(!chat_uuid || !text) return failure(res,'no uuid or text')
if(!bot.chat_id || !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}})
const theChat = await models.Chat.findOne({where:{id: bot.chat_id}})
if(!theChat || !owner) return failure(res,'no chat')
if(!theChat.type===constants.chat_types.tribe) return failure(res,'not a tribe')
@ -84,7 +64,7 @@ async 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:{[k:string]:any}={
chatId: theChat.id,
uuid: short.generate(),

2
api/controllers/index.ts

@ -93,7 +93,7 @@ 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('/version', async function(req,res) {
const version = await checkTag()

3
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

22
api/models/ts/bot.ts

@ -0,0 +1,22 @@
import { Table, Column, Model, DataType } from 'sequelize-typescript';
@Table({tableName: 'sphinx_bots', underscored: true})
export default class Bot extends Model<Bot> {
@Column({
type: DataType.TEXT,
primaryKey: true,
unique: true,
})
id: string
@Column(DataType.BIGINT)
chatId: number
@Column
name: string
@Column
secret: string
}

11
api/utils/setup.ts

@ -31,6 +31,17 @@ 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
)`)
} catch(e){}
addTableColumn('sphinx_chats', 'app_url')
try{

45
dist/api/controllers/actions.js

@ -11,40 +11,17 @@ 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");
/*
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) {
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,12 +34,11 @@ 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) {
@ -88,10 +64,10 @@ function processExtra(req, res) {
}
}
else if (action === 'broadcast') {
if (!chat_uuid || !text)
if (!bot.chat_id || !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.chat_id } });
if (!theChat || !owner)
return res_1.failure(res, 'no chat');
if (!theChat.type === constants.chat_types.tribe)
@ -101,7 +77,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 +107,5 @@ function processExtra(req, res) {
}
});
}
exports.processAction = processAction;
//# sourceMappingURL=actions.js.map

2
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,sCAAkC;AAClC,oCAAmC;AACnC,qCAAoC;AAEpC;;EAEE;AAEF,MAAM,UAAU,GAAG,uBAAuB,CAAA;AAC1C,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,CAAA;AAE7E,SAAsB,QAAQ,CAAC,GAAG,EAAE,GAAG;;QACnC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,UAAU,CAAC,CAAA;QAC/C,IAAI;YACA,IA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,CAAC,aAAO,CAAC,GAAG,EAAE,EAAC,OAAO,EAAC,IAAI,EAAC,CAAC;gBAC1C,OAAO,EAAE,GAAE,EAAE,CAAC,aAAO,CAAC,GAAG,EAAE,QAAQ,CAAC;aACvC,CAAC,CAAA;SACL;aAAM;YACH,OAAO,aAAO,CAAC,GAAG,EAAE,WAAW,CAAC,CAAA;SACnC;IACL,CAAC;CAAA;AA/ED,sCA+EC"}

2
dist/api/controllers/index.js

@ -90,7 +90,7 @@ 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('/version', function (req, res) {
return __awaiter(this, void 0, void 0, function* () {
const version = yield gitinfo_1.checkTag();

2
dist/api/controllers/index.js.map

File diff suppressed because one or more lines are too long

3
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;

2
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,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,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"}

39
dist/api/models/ts/bot.js

@ -0,0 +1,39 @@
"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);
Bot = __decorate([
sequelize_typescript_1.Table({ tableName: 'sphinx_bots', underscored: true })
], Bot);
exports.default = Bot;
//# sourceMappingURL=bot.js.map

1
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;CAkB1C,CAAA;AAXC;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;AAhBK,GAAG;IADvB,4BAAK,CAAC,EAAC,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,IAAI,EAAC,CAAC;GAChC,GAAG,CAkBvB;kBAlBoB,GAAG"}

10
dist/api/utils/setup.js

@ -44,6 +44,16 @@ 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
)`);
}
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);`);

2
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,8CAA0D;AAE1D,MAAM,YAAY,GAAG,CAAC,CAAA;AAEtB,MAAM,aAAa,GAAG,GAAS,EAAE;IAC/B,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAA;IACxC,MAAM,UAAU,EAAE,CA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