Browse Source

Merge pull request #71 from stakwork/bots

Bots
push-params v0.10.8
Evan Feenstra 4 years ago
committed by GitHub
parent
commit
f731f487aa
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/workflows/release.yml
  2. 2
      .github/workflows/update.yml
  3. 119
      api/controllers/actions.ts
  4. 5
      api/controllers/index.ts
  5. 3
      api/models/index.ts
  6. 28
      api/models/ts/bot.ts
  7. 3
      api/utils/json.ts
  8. 13
      api/utils/setup.ts
  9. 89
      dist/api/controllers/actions.js
  10. 2
      dist/api/controllers/actions.js.map
  11. 5
      dist/api/controllers/index.js
  12. 2
      dist/api/controllers/index.js.map
  13. 3
      dist/api/models/index.js
  14. 2
      dist/api/models/index.js.map
  15. 47
      dist/api/models/ts/bot.js
  16. 1
      dist/api/models/ts/bot.js.map
  17. 2
      dist/api/utils/json.js
  18. 2
      dist/api/utils/json.js.map
  19. 12
      dist/api/utils/setup.js
  20. 2
      dist/api/utils/setup.js.map

2
.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'}"
data: "{'text': '[GITHUB] New release in sphinx-relay! ${{ env.HEAD_TAG }}', 'action': 'broadcast', 'bot_id': '87B4FDD3DD71C2B0', 'bot_secret': '${{ secrets.WEBHOOK_SECRET }}'}"

2
.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'}"
data: "{'text': 'New push in sphinx-relay by ${{ env.COMMIT_AUTHOR }}: ${{ env.COMMIT_MSG }}', 'action': 'broadcast', 'bot_id': '87B4FDD3DD71C2B0', 'bot_secret': '${{ secrets.WEBHOOK_SECRET }}'}"

119
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')

5
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()

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

28
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<Bot> {
@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
}

3
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,
}

13
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{

89
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

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

File diff suppressed because one or more lines are too long

5
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();

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

47
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

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;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"}

2
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) {

2
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,CAAC,CAAC;IACnB,IAAG,CAAC,CAAC;QAAE,OAAO,EAAE,CAAA;IAChB,MAAM,EAAE,GAAG,CAAC,CAAC,UAAU,IAAE,CAAC,CAAA;IAC1B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAA;IAC3C,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAA;IACxC,IAAG,IAAI,CAAC,UAAU,IAAI,OAAO,IAAI,CAAC,UAAU,KAAG,QAAQ,EAAC;QACtD,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;KACzC;IACD,OAAO,IAAI,CAAC,eAAe,CAAA;IAC3B,OAAO,cAAO,iCACT,IAAI,KACP,UAAU,IACV,CAAA;AACJ,CAAC;AA0CC,gCAAU;AAxCZ,SAAS,aAAa,CAA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aiter(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);`);

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,CAAA;IAClB,IAAI;QACF,MAAM,kBAAS,CAAC,IAAI,EAAE,CAAA;QACtB,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA;KACpC;IAAC,OAAM,CAAC,EAAE;QACT,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAC,CAAC,CAAC,CAAA;KAChC;IACD,MAAM,OAAO,EAAE,CAAA;IACf,iBAAiB,EAAE,CAAA;IACnB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;AACnC,CAAC,CAAA,CAAA;AAqGQ,sCAAa;AAnGtB,SAAe,UAAU;;QACvB,IAAI;YACF,MAAM,kBAAS,CAAC,KAAK,CAAC,yBAAyB,YAAY,EAAE,CAAC,CAAA;SAC/D;QAAC,OAAM,CAAC,EAAE;YACT,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAC,CAAC,CAAC,CAAA;SACtC;IACH,CAAC;CAAA;AAED,SAAe,OAAO;;QACpB,cAAc,CA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