Built motion from commit be44e1e4d16f8b29d243415b03d27262d8601e0e. Version 3.0.0...
[motion-next.git] / server / migrations / 2.0.48.js
1 const a927_0xd530=['addIndex','stringify','fax_interactions','yes','info','../config/logger','removeColumn','Changed\x20column\x20%s\x20in\x20table\x20%s','turnaddr','utf8','Added\x20column\x20%s\x20to\x20%s','addColumn','util','[ice_host_candidates]','queryInterface','dropTable','UPDATE\x20mail_interactions\x20t1,\x20(SELECT\x20MailInteractionId,\x20MIN(id)\x20AS\x20messageid,\x20ANY_VALUE(direction)\x20AS\x20direction\x20FROM\x20mail_messages\x20WHERE\x20MailInteractionId\x20IS\x20NOT\x20NULL\x20GROUP\x20BY\x20MailInteractionId)\x20t2\x20SET\x20t1.firstMsgDirection\x20=\x20t2.direction\x20WHERE\x20t1.id\x20=\x20t2.MailInteractionId;','tail','users','UPDATE\x20users\x20SET\x20rtcp_mux=\x27yes\x27\x20WHERE\x20showWebBar=2','final','replace','table\x20dropped\x20%s','ENUM','sms_interactions','lodash','addIndex\x20%s\x20%s\x20%s','migration','UPDATE\x20sms_interactions\x20t1,\x20(SELECT\x20SmsInteractionId,\x20MIN(id)\x20AS\x20messageid,\x20ANY_VALUE(direction)\x20AS\x20direction\x20FROM\x20sms_messages\x20WHERE\x20SmsInteractionId\x20IS\x20NOT\x20NULL\x20GROUP\x20BY\x20SmsInteractionId)\x20t2\x20SET\x20t1.firstMsgDirection\x20=\x20t2.direction\x20WHERE\x20t1.id\x20=\x20t2.SmsInteractionId;','sequence','/etc/asterisk/rtp.conf','finally','readFileSync','exports','out','mail_interactions','turnusername','query\x20%s','writeFileSync','settings','#include\x20\x22stun_xcally.conf\x22\x0a#include\x20\x22turn_xcally.conf\x22\x0a[ice_host_candidates]','catch','appendFileSync','/etc/asterisk/turn_xcally.conf','/etc/asterisk/res_stun_monitor.conf','firstMsgDirection','then','turnpassword','prototype','/etc/asterisk/stun_xcally.conf','join','changeColumn','query','enqueue'];(function(_0x3105a8,_0xd530cd){const _0x51ab58=function(_0x9f6f22){while(--_0x9f6f22){_0x3105a8['push'](_0x3105a8['shift']());}};_0x51ab58(++_0xd530cd);}(a927_0xd530,0x13c));const a927_0x51ab=function(_0x3105a8,_0xd530cd){_0x3105a8=_0x3105a8-0x0;let _0x51ab58=a927_0xd530[_0x3105a8];return _0x51ab58;};const _0x54b380=a927_0x51ab;'use strict';const fs=require('fs'),util=require(_0x54b380('0x14')),_=require(_0x54b380('0x21')),logger=require(_0x54b380('0xd'))(_0x54b380('0x23')),Sequence=function(){};Sequence[_0x54b380('0x2')][_0x54b380('0x7')]=function(_0x9f6f22){const _0x1a7ea6=_0x54b380;this[_0x1a7ea6('0x19')]=this[_0x1a7ea6('0x19')]?this[_0x1a7ea6('0x19')][_0x1a7ea6('0x27')](_0x9f6f22):_0x9f6f22();};const Migration=function(_0x1d5d09){const _0x30d086=_0x54b380;this[_0x30d086('0x16')]=_0x1d5d09,this[_0x30d086('0x25')]=new Sequence();};Migration[_0x54b380('0x2')][_0x54b380('0x5')]=function(_0x5e6366,_0x14551f,_0x20857f){const _0x5814f0=_0x54b380,_0xab646d=this;this[_0x5814f0('0x25')][_0x5814f0('0x7')](function(){const _0x16c0f=_0x5814f0;return _0xab646d[_0x16c0f('0x16')][_0x16c0f('0x5')](_0x5e6366,_0x14551f,_0x20857f)['then'](function(){const _0x4a96a1=_0x16c0f;logger[_0x4a96a1('0xc')](_0x4a96a1('0xf'),_0x14551f,_0x5e6366);})[_0x16c0f('0x31')](function(_0x5021cd){const _0x5ad313=_0x16c0f;logger[_0x5ad313('0xc')](JSON['stringify'](_0x5021cd));});});},Migration[_0x54b380('0x2')]['addColumn']=function(_0x35676e,_0x1c5289,_0x2517d7){const _0x130d02=_0x54b380,_0x389049=this;this[_0x130d02('0x25')][_0x130d02('0x7')](function(){const _0x3fe094=_0x130d02;return _0x389049[_0x3fe094('0x16')][_0x3fe094('0x13')](_0x35676e,_0x1c5289,_0x2517d7)[_0x3fe094('0x0')](function(){const _0x4ea144=_0x3fe094;logger['info'](_0x4ea144('0x12'),_0x1c5289,_0x35676e);})[_0x3fe094('0x31')](function(_0x2b0941){logger['info'](JSON['stringify'](_0x2b0941));});});},Migration[_0x54b380('0x2')]['dropTable']=function(_0x12005e){const _0x238035=_0x54b380,_0x48e075=this;this[_0x238035('0x25')][_0x238035('0x7')](function(){const _0x1c74d8=_0x238035;return _0x48e075[_0x1c74d8('0x16')][_0x1c74d8('0x17')](_0x12005e,{'force':!![]})['then'](function(){const _0x2ca6bb=_0x1c74d8;logger[_0x2ca6bb('0xc')](_0x2ca6bb('0x1e'),_0x12005e);})[_0x1c74d8('0x31')](function(_0x163b79){const _0x487c5a=_0x1c74d8;logger[_0x487c5a('0xc')](JSON[_0x487c5a('0x9')](_0x163b79));});});},Migration['prototype'][_0x54b380('0x8')]=function(_0x20089c,_0x3466aa,_0x5acdb3){const _0x23a44a=_0x54b380,_0x2be07b=this;this[_0x23a44a('0x25')][_0x23a44a('0x7')](function(){const _0x22505e=_0x23a44a;return _0x2be07b[_0x22505e('0x16')][_0x22505e('0x8')](_0x20089c,_0x3466aa,{'indexName':_0x5acdb3})[_0x22505e('0x0')](function(){const _0xec31d5=_0x22505e;logger[_0xec31d5('0xc')](_0xec31d5('0x22'),_0x20089c,_0x3466aa[_0xec31d5('0x4')](','),_0x5acdb3);})['catch'](function(_0x420d3a){const _0x216e70=_0x22505e;logger[_0x216e70('0xc')](JSON[_0x216e70('0x9')](_0x420d3a));});});},Migration[_0x54b380('0x2')]['query']=function(_0x36d929){const _0x11880e=_0x54b380,_0x2375ca=this;this[_0x11880e('0x25')][_0x11880e('0x7')](function(){const _0x3cc5b5=_0x11880e;return _0x2375ca[_0x3cc5b5('0x16')]['sequelize'][_0x3cc5b5('0x6')](_0x36d929)[_0x3cc5b5('0x0')](function(){const _0x183564=_0x3cc5b5;logger['info'](_0x183564('0x2d'),_0x36d929);})['catch'](function(_0x2450ae){const _0x447b7f=_0x3cc5b5;logger[_0x447b7f('0xc')](JSON[_0x447b7f('0x9')](_0x2450ae));});});},Migration[_0x54b380('0x2')][_0x54b380('0xe')]=function(_0x5a7c1f,_0x262afb){const _0x241d87=_0x54b380,_0x435d72=this;this['sequence'][_0x241d87('0x7')](function(){const _0xd0d57a=_0x241d87;return _0x435d72[_0xd0d57a('0x16')][_0xd0d57a('0xe')](_0x5a7c1f,_0x262afb)['then'](function(){const _0x2a6ac0=_0xd0d57a;logger[_0x2a6ac0('0xc')]('Removed\x20column\x20%s\x20from\x20%s',_0x262afb,_0x5a7c1f);})[_0xd0d57a('0x31')](function(_0x433fbd){const _0x128aa3=_0xd0d57a;logger[_0x128aa3('0xc')](util['inspect'](_0x433fbd,{'showHidden':![],'depth':null}));});});},Migration[_0x54b380('0x2')][_0x54b380('0x1c')]=function(_0x51e5f1){const _0x247fc3=_0x54b380;this[_0x247fc3('0x25')][_0x247fc3('0x7')](function(){return _0x51e5f1();});},module[_0x54b380('0x29')]={'up':function(_0x429906,_0x5f580a){return new Promise(function(_0x56563c){const _0x48befc=a927_0x51ab,_0xf503ca=new Migration(_0x429906);_0xf503ca[_0x48befc('0x13')](_0x48befc('0x2f'),_0x48befc('0x10'),{'type':_0x5f580a['STRING']}),_0xf503ca[_0x48befc('0x13')](_0x48befc('0x2f'),_0x48befc('0x2c'),{'type':_0x5f580a['STRING']}),_0xf503ca[_0x48befc('0x13')](_0x48befc('0x2f'),_0x48befc('0x1'),{'type':_0x5f580a['STRING']}),_0xf503ca[_0x48befc('0x13')](_0x48befc('0x1a'),'rtcp_mux',{'type':_0x5f580a[_0x48befc('0x1f')](_0x48befc('0xb'),'no'),'defaultValue':'no'}),_0xf503ca[_0x48befc('0x6')](_0x48befc('0x1b')),_0xf503ca[_0x48befc('0x13')](_0x48befc('0x20'),_0x48befc('0x35'),{'type':_0x5f580a[_0x48befc('0x1f')]('in','out'),'defaultValue':'in','allowNull':![]}),_0xf503ca['query'](_0x48befc('0x24')),_0xf503ca[_0x48befc('0x13')](_0x48befc('0x2b'),_0x48befc('0x35'),{'type':_0x5f580a[_0x48befc('0x1f')]('in',_0x48befc('0x2a')),'defaultValue':'in','allowNull':![]}),_0xf503ca[_0x48befc('0x6')](_0x48befc('0x18')),_0xf503ca[_0x48befc('0x13')](_0x48befc('0xa'),'firstMsgDirection',{'type':_0x5f580a[_0x48befc('0x1f')]('in','out'),'defaultValue':'in','allowNull':![]}),_0xf503ca[_0x48befc('0x6')]('UPDATE\x20fax_interactions\x20t1,\x20(SELECT\x20FaxInteractionId,\x20MIN(id)\x20AS\x20messageid,\x20ANY_VALUE(direction)\x20AS\x20direction\x20FROM\x20fax_messages\x20WHERE\x20FaxInteractionId\x20IS\x20NOT\x20NULL\x20GROUP\x20BY\x20FaxInteractionId)\x20t2\x20SET\x20t1.firstMsgDirection\x20=\x20t2.direction\x20WHERE\x20t1.id\x20=\x20t2.FaxInteractionId;');try{fs[_0x48befc('0x2e')](_0x48befc('0x3'),';\x20STUN\x20server\x20list\x0a',{'encoding':_0x48befc('0x11')}),fs[_0x48befc('0x2e')](_0x48befc('0x33'),';\x20TURN\x20server\x20list\x0a',{'encoding':_0x48befc('0x11')});let _0x51e539=fs[_0x48befc('0x28')]('/etc/asterisk/rtp.conf',{'encoding':_0x48befc('0x11')});_0x51e539=_[_0x48befc('0x1d')](_0x51e539,_0x48befc('0x15'),_0x48befc('0x30')),fs[_0x48befc('0x2e')](_0x48befc('0x26'),_0x51e539,{'encoding':_0x48befc('0x11')}),fs[_0x48befc('0x32')](_0x48befc('0x34'),'#include\x20\x22stun_xcally.conf\x22',{'encoding':'utf8'});}catch(_0x3ad36b){logger['info'](JSON[_0x48befc('0x9')](_0x3ad36b));}_0xf503ca[_0x48befc('0x1c')](_0x56563c);});},'down':function(){}};