Built motion from commit a9fb64cc6defd8fb3a5cc199221f878e91c0e969. Version 3.0.0...
[motion-next.git] / server / migrations / 2.0.48.js
index 9e06f60..92da62b 100644 (file)
@@ -1 +1 @@
-const a927_0x542a=['then','/etc/asterisk/turn_xcally.conf','changeColumn','Changed\x20column\x20%s\x20in\x20table\x20%s','users','catch','removeColumn','STRING','writeFileSync','/etc/asterisk/stun_xcally.conf','firstMsgDirection','rtcp_mux','sequence','Removed\x20column\x20%s\x20from\x20%s','dropTable','queryInterface','/etc/asterisk/rtp.conf','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;','join','out','../config/logger','turnaddr','Added\x20column\x20%s\x20to\x20%s','query','#include\x20\x22stun_xcally.conf\x22','enqueue','tail','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;','[ice_host_candidates]','mail_interactions','ENUM','query\x20%s','finally','addColumn',';\x20STUN\x20server\x20list\x0a','#include\x20\x22stun_xcally.conf\x22\x0a#include\x20\x22turn_xcally.conf\x22\x0a[ice_host_candidates]','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;','prototype','inspect','turnusername','appendFileSync','stringify','readFileSync','fax_interactions','final','settings','table\x20dropped\x20%s','addIndex\x20%s\x20%s\x20%s','sms_interactions','utf8','sequelize','info','lodash','UPDATE\x20users\x20SET\x20rtcp_mux=\x27yes\x27\x20WHERE\x20showWebBar=2','/etc/asterisk/res_stun_monitor.conf'];(function(_0x2ec841,_0x542a06){const _0x57d4=function(_0x28b779){while(--_0x28b779){_0x2ec841['push'](_0x2ec841['shift']());}};_0x57d4(++_0x542a06);}(a927_0x542a,0xf7));const a927_0x57d4=function(_0x2ec841,_0x542a06){_0x2ec841=_0x2ec841-0x0;let _0x57d4=a927_0x542a[_0x2ec841];return _0x57d4;};const _0x5cb8a9=a927_0x57d4;'use strict';const fs=require('fs'),util=require('util'),_=require(_0x5cb8a9('0x19')),logger=require(_0x5cb8a9('0x30'))('migration'),Sequence=function(){};Sequence[_0x5cb8a9('0xa')]['enqueue']=function(_0x28b779){const _0x114d61=_0x5cb8a9;this['tail']=this[_0x114d61('0x36')]?this[_0x114d61('0x36')][_0x114d61('0x5')](_0x28b779):_0x28b779();};const Migration=function(_0xab141d){const _0x1df1d2=_0x5cb8a9;this[_0x1df1d2('0x2b')]=_0xab141d,this['sequence']=new Sequence();};Migration[_0x5cb8a9('0xa')][_0x5cb8a9('0x1e')]=function(_0x37744f,_0x54ad8b,_0x243f10){const _0x1237e0=_0x5cb8a9,_0x27b2b0=this;this[_0x1237e0('0x28')][_0x1237e0('0x35')](function(){const _0x33aa23=_0x1237e0;return _0x27b2b0[_0x33aa23('0x2b')][_0x33aa23('0x1e')](_0x37744f,_0x54ad8b,_0x243f10)[_0x33aa23('0x1c')](function(){const _0x278bbe=_0x33aa23;logger[_0x278bbe('0x18')](_0x278bbe('0x1f'),_0x54ad8b,_0x37744f);})[_0x33aa23('0x21')](function(_0x4ca830){const _0x41a199=_0x33aa23;logger['info'](JSON[_0x41a199('0xe')](_0x4ca830));});});},Migration[_0x5cb8a9('0xa')][_0x5cb8a9('0x6')]=function(_0x4b48ae,_0x32243e,_0x349cd4){const _0x6d92f2=_0x5cb8a9,_0x2b1408=this;this[_0x6d92f2('0x28')][_0x6d92f2('0x35')](function(){const _0x31c24c=_0x6d92f2;return _0x2b1408[_0x31c24c('0x2b')]['addColumn'](_0x4b48ae,_0x32243e,_0x349cd4)[_0x31c24c('0x1c')](function(){const _0x2db5b1=_0x31c24c;logger[_0x2db5b1('0x18')](_0x2db5b1('0x32'),_0x32243e,_0x4b48ae);})[_0x31c24c('0x21')](function(_0x4971b8){const _0x4fe64f=_0x31c24c;logger[_0x4fe64f('0x18')](JSON[_0x4fe64f('0xe')](_0x4971b8));});});},Migration[_0x5cb8a9('0xa')][_0x5cb8a9('0x2a')]=function(_0x6b7b98){const _0x193c15=_0x5cb8a9,_0x4667d1=this;this[_0x193c15('0x28')][_0x193c15('0x35')](function(){const _0x996dfd=_0x193c15;return _0x4667d1[_0x996dfd('0x2b')]['dropTable'](_0x6b7b98,{'force':!![]})[_0x996dfd('0x1c')](function(){const _0x58e346=_0x996dfd;logger[_0x58e346('0x18')](_0x58e346('0x13'),_0x6b7b98);})[_0x996dfd('0x21')](function(_0x4cd1b8){const _0x31f1d9=_0x996dfd;logger['info'](JSON[_0x31f1d9('0xe')](_0x4cd1b8));});});},Migration[_0x5cb8a9('0xa')]['addIndex']=function(_0x4baba1,_0x307a4b,_0x257101){const _0x49e3fb=_0x5cb8a9,_0x4dece2=this;this[_0x49e3fb('0x28')][_0x49e3fb('0x35')](function(){const _0x34bdb7=_0x49e3fb;return _0x4dece2['queryInterface']['addIndex'](_0x4baba1,_0x307a4b,{'indexName':_0x257101})[_0x34bdb7('0x1c')](function(){const _0xaf0e0=_0x34bdb7;logger[_0xaf0e0('0x18')](_0xaf0e0('0x14'),_0x4baba1,_0x307a4b[_0xaf0e0('0x2e')](','),_0x257101);})[_0x34bdb7('0x21')](function(_0x2d8f45){logger['info'](JSON['stringify'](_0x2d8f45));});});},Migration['prototype'][_0x5cb8a9('0x33')]=function(_0x34bddd){const _0xf3c617=_0x5cb8a9,_0x49d91b=this;this[_0xf3c617('0x28')][_0xf3c617('0x35')](function(){const _0x41e997=_0xf3c617;return _0x49d91b[_0x41e997('0x2b')][_0x41e997('0x17')][_0x41e997('0x33')](_0x34bddd)[_0x41e997('0x1c')](function(){const _0x6e8abd=_0x41e997;logger['info'](_0x6e8abd('0x4'),_0x34bddd);})['catch'](function(_0x2ca1a9){const _0xaa0fde=_0x41e997;logger[_0xaa0fde('0x18')](JSON['stringify'](_0x2ca1a9));});});},Migration[_0x5cb8a9('0xa')][_0x5cb8a9('0x22')]=function(_0x580314,_0x7b94f0){const _0x36d900=_0x5cb8a9,_0x3eda81=this;this[_0x36d900('0x28')]['enqueue'](function(){const _0x1fb591=_0x36d900;return _0x3eda81[_0x1fb591('0x2b')][_0x1fb591('0x22')](_0x580314,_0x7b94f0)[_0x1fb591('0x1c')](function(){const _0x69d8e9=_0x1fb591;logger[_0x69d8e9('0x18')](_0x69d8e9('0x29'),_0x7b94f0,_0x580314);})[_0x1fb591('0x21')](function(_0xcba73d){const _0x315202=_0x1fb591;logger['info'](util[_0x315202('0xb')](_0xcba73d,{'showHidden':![],'depth':null}));});});},Migration['prototype'][_0x5cb8a9('0x11')]=function(_0x47b546){const _0x3d43cd=_0x5cb8a9;this[_0x3d43cd('0x28')][_0x3d43cd('0x35')](function(){return _0x47b546();});},module['exports']={'up':function(_0x5489bf,_0x153514){return new Promise(function(_0xbcb914){const _0x4f0b3b=a927_0x57d4,_0x2adf86=new Migration(_0x5489bf);_0x2adf86[_0x4f0b3b('0x6')](_0x4f0b3b('0x12'),_0x4f0b3b('0x31'),{'type':_0x153514[_0x4f0b3b('0x23')]}),_0x2adf86[_0x4f0b3b('0x6')](_0x4f0b3b('0x12'),_0x4f0b3b('0xc'),{'type':_0x153514['STRING']}),_0x2adf86[_0x4f0b3b('0x6')]('settings','turnpassword',{'type':_0x153514[_0x4f0b3b('0x23')]}),_0x2adf86[_0x4f0b3b('0x6')](_0x4f0b3b('0x20'),_0x4f0b3b('0x27'),{'type':_0x153514[_0x4f0b3b('0x3')]('yes','no'),'defaultValue':'no'}),_0x2adf86[_0x4f0b3b('0x33')](_0x4f0b3b('0x1a')),_0x2adf86[_0x4f0b3b('0x6')](_0x4f0b3b('0x15'),_0x4f0b3b('0x26'),{'type':_0x153514['ENUM']('in',_0x4f0b3b('0x2f')),'defaultValue':'in','allowNull':![]}),_0x2adf86['query'](_0x4f0b3b('0x9')),_0x2adf86[_0x4f0b3b('0x6')](_0x4f0b3b('0x2'),_0x4f0b3b('0x26'),{'type':_0x153514[_0x4f0b3b('0x3')]('in',_0x4f0b3b('0x2f')),'defaultValue':'in','allowNull':![]}),_0x2adf86[_0x4f0b3b('0x33')](_0x4f0b3b('0x2d')),_0x2adf86[_0x4f0b3b('0x6')](_0x4f0b3b('0x10'),_0x4f0b3b('0x26'),{'type':_0x153514[_0x4f0b3b('0x3')]('in',_0x4f0b3b('0x2f')),'defaultValue':'in','allowNull':![]}),_0x2adf86[_0x4f0b3b('0x33')](_0x4f0b3b('0x0'));try{fs[_0x4f0b3b('0x24')](_0x4f0b3b('0x25'),_0x4f0b3b('0x7'),{'encoding':_0x4f0b3b('0x16')}),fs[_0x4f0b3b('0x24')](_0x4f0b3b('0x1d'),';\x20TURN\x20server\x20list\x0a',{'encoding':_0x4f0b3b('0x16')});let _0x589675=fs[_0x4f0b3b('0xf')]('/etc/asterisk/rtp.conf',{'encoding':'utf8'});_0x589675=_['replace'](_0x589675,_0x4f0b3b('0x1'),_0x4f0b3b('0x8')),fs[_0x4f0b3b('0x24')](_0x4f0b3b('0x2c'),_0x589675,{'encoding':'utf8'}),fs[_0x4f0b3b('0xd')](_0x4f0b3b('0x1b'),_0x4f0b3b('0x34'),{'encoding':'utf8'});}catch(_0x5058eb){logger['info'](JSON[_0x4f0b3b('0xe')](_0x5058eb));}_0x2adf86[_0x4f0b3b('0x11')](_0xbcb914);});},'down':function(){}};
\ No newline at end of file
+const a927_0x4a47=['yes','finally','settings','sequelize','turnaddr','addColumn','readFileSync','dropTable','lodash','catch','/etc/asterisk/turn_xcally.conf','mail_interactions','query\x20%s','enqueue','replace','changeColumn','turnpassword','/etc/asterisk/stun_xcally.conf','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;','STRING','query','addIndex','join','inspect','Removed\x20column\x20%s\x20from\x20%s','fax_interactions','util','[ice_host_candidates]','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;','info','#include\x20\x22stun_xcally.conf\x22\x0a#include\x20\x22turn_xcally.conf\x22\x0a[ice_host_candidates]','exports','rtcp_mux','removeColumn','../config/logger','ENUM','firstMsgDirection','queryInterface','sequence','then','Added\x20column\x20%s\x20to\x20%s','tail','prototype',';\x20STUN\x20server\x20list\x0a','utf8','UPDATE\x20users\x20SET\x20rtcp_mux=\x27yes\x27\x20WHERE\x20showWebBar=2','sms_interactions','out',';\x20TURN\x20server\x20list\x0a','/etc/asterisk/res_stun_monitor.conf','stringify','writeFileSync','final','Changed\x20column\x20%s\x20in\x20table\x20%s'];(function(_0x24534a,_0x4a47b0){const _0x23ba69=function(_0x31a52a){while(--_0x31a52a){_0x24534a['push'](_0x24534a['shift']());}};_0x23ba69(++_0x4a47b0);}(a927_0x4a47,0x6a));const a927_0x23ba=function(_0x24534a,_0x4a47b0){_0x24534a=_0x24534a-0x0;let _0x23ba69=a927_0x4a47[_0x24534a];return _0x23ba69;};const _0x19662e=a927_0x23ba;'use strict';const fs=require('fs'),util=require(_0x19662e('0x1f')),_=require(_0x19662e('0xc')),logger=require(_0x19662e('0x27'))(_0x19662e('0x16')),Sequence=function(){};Sequence[_0x19662e('0x2f')]['enqueue']=function(_0x31a52a){const _0x249eb2=_0x19662e;this[_0x249eb2('0x2e')]=this[_0x249eb2('0x2e')]?this[_0x249eb2('0x2e')][_0x249eb2('0x5')](_0x31a52a):_0x31a52a();};const Migration=function(_0x59a146){const _0x422d77=_0x19662e;this[_0x422d77('0x2a')]=_0x59a146,this[_0x422d77('0x2b')]=new Sequence();};Migration[_0x19662e('0x2f')][_0x19662e('0x13')]=function(_0x35f1e9,_0x149793,_0x21706f){const _0x5b2883=_0x19662e,_0x3ac703=this;this[_0x5b2883('0x2b')][_0x5b2883('0x11')](function(){const _0x30a6c1=_0x5b2883;return _0x3ac703[_0x30a6c1('0x2a')][_0x30a6c1('0x13')](_0x35f1e9,_0x149793,_0x21706f)[_0x30a6c1('0x2c')](function(){const _0x288bb6=_0x30a6c1;logger[_0x288bb6('0x22')](_0x288bb6('0x3'),_0x149793,_0x35f1e9);})[_0x30a6c1('0xd')](function(_0xcd17f0){const _0x3834ab=_0x30a6c1;logger[_0x3834ab('0x22')](JSON['stringify'](_0xcd17f0));});});},Migration[_0x19662e('0x2f')]['addColumn']=function(_0x29b7e6,_0x13342f,_0x31efee){const _0x2b1047=this;this['sequence']['enqueue'](function(){const _0x139351=a927_0x23ba;return _0x2b1047[_0x139351('0x2a')][_0x139351('0x9')](_0x29b7e6,_0x13342f,_0x31efee)[_0x139351('0x2c')](function(){const _0x17ab52=_0x139351;logger[_0x17ab52('0x22')](_0x17ab52('0x2d'),_0x13342f,_0x29b7e6);})[_0x139351('0xd')](function(_0x4e7bc9){const _0x450d8f=_0x139351;logger[_0x450d8f('0x22')](JSON['stringify'](_0x4e7bc9));});});},Migration['prototype'][_0x19662e('0xb')]=function(_0x44c495){const _0xcbd891=_0x19662e,_0x22700e=this;this[_0xcbd891('0x2b')][_0xcbd891('0x11')](function(){const _0x3a08ee=_0xcbd891;return _0x22700e['queryInterface'][_0x3a08ee('0xb')](_0x44c495,{'force':!![]})['then'](function(){const _0x1fcfd4=_0x3a08ee;logger[_0x1fcfd4('0x22')]('table\x20dropped\x20%s',_0x44c495);})[_0x3a08ee('0xd')](function(_0x5e12e0){const _0x55a555=_0x3a08ee;logger[_0x55a555('0x22')](JSON[_0x55a555('0x0')](_0x5e12e0));});});},Migration[_0x19662e('0x2f')][_0x19662e('0x1a')]=function(_0xae5723,_0x5498e9,_0x2eab04){const _0x317734=_0x19662e,_0xed0128=this;this[_0x317734('0x2b')][_0x317734('0x11')](function(){const _0x2eb93d=_0x317734;return _0xed0128['queryInterface']['addIndex'](_0xae5723,_0x5498e9,{'indexName':_0x2eab04})[_0x2eb93d('0x2c')](function(){const _0x35a9bf=_0x2eb93d;logger['info']('addIndex\x20%s\x20%s\x20%s',_0xae5723,_0x5498e9[_0x35a9bf('0x1b')](','),_0x2eab04);})[_0x2eb93d('0xd')](function(_0x2cf8b5){const _0x4ed7e6=_0x2eb93d;logger[_0x4ed7e6('0x22')](JSON[_0x4ed7e6('0x0')](_0x2cf8b5));});});},Migration[_0x19662e('0x2f')][_0x19662e('0x19')]=function(_0xa32b33){const _0xd3fef1=_0x19662e,_0x34fbe8=this;this[_0xd3fef1('0x2b')][_0xd3fef1('0x11')](function(){const _0x53c936=_0xd3fef1;return _0x34fbe8[_0x53c936('0x2a')][_0x53c936('0x7')][_0x53c936('0x19')](_0xa32b33)[_0x53c936('0x2c')](function(){const _0x3cc1e9=_0x53c936;logger[_0x3cc1e9('0x22')](_0x3cc1e9('0x10'),_0xa32b33);})[_0x53c936('0xd')](function(_0x318f8a){const _0x4ee862=_0x53c936;logger[_0x4ee862('0x22')](JSON[_0x4ee862('0x0')](_0x318f8a));});});},Migration['prototype'][_0x19662e('0x26')]=function(_0x45a059,_0x3915ed){const _0x2a9ac6=_0x19662e,_0x110f25=this;this[_0x2a9ac6('0x2b')]['enqueue'](function(){const _0x35a4ae=_0x2a9ac6;return _0x110f25['queryInterface'][_0x35a4ae('0x26')](_0x45a059,_0x3915ed)[_0x35a4ae('0x2c')](function(){const _0x122a50=_0x35a4ae;logger[_0x122a50('0x22')](_0x122a50('0x1d'),_0x3915ed,_0x45a059);})[_0x35a4ae('0xd')](function(_0x508712){const _0x262531=_0x35a4ae;logger[_0x262531('0x22')](util[_0x262531('0x1c')](_0x508712,{'showHidden':![],'depth':null}));});});},Migration[_0x19662e('0x2f')]['final']=function(_0xe4d4f0){const _0x2e7ab4=_0x19662e;this[_0x2e7ab4('0x2b')]['enqueue'](function(){return _0xe4d4f0();});},module[_0x19662e('0x24')]={'up':function(_0x3595b9,_0x3fc3c0){return new Promise(function(_0x3d5575){const _0x518ab4=a927_0x23ba,_0x277a5b=new Migration(_0x3595b9);_0x277a5b[_0x518ab4('0x9')](_0x518ab4('0x6'),_0x518ab4('0x8'),{'type':_0x3fc3c0[_0x518ab4('0x18')]}),_0x277a5b[_0x518ab4('0x9')]('settings','turnusername',{'type':_0x3fc3c0['STRING']}),_0x277a5b[_0x518ab4('0x9')](_0x518ab4('0x6'),_0x518ab4('0x14'),{'type':_0x3fc3c0[_0x518ab4('0x18')]}),_0x277a5b['addColumn']('users',_0x518ab4('0x25'),{'type':_0x3fc3c0[_0x518ab4('0x28')](_0x518ab4('0x4'),'no'),'defaultValue':'no'}),_0x277a5b[_0x518ab4('0x19')](_0x518ab4('0x32')),_0x277a5b[_0x518ab4('0x9')](_0x518ab4('0x33'),'firstMsgDirection',{'type':_0x3fc3c0[_0x518ab4('0x28')]('in','out'),'defaultValue':'in','allowNull':![]}),_0x277a5b[_0x518ab4('0x19')](_0x518ab4('0x17')),_0x277a5b['addColumn'](_0x518ab4('0xf'),'firstMsgDirection',{'type':_0x3fc3c0[_0x518ab4('0x28')]('in',_0x518ab4('0x34')),'defaultValue':'in','allowNull':![]}),_0x277a5b['query'](_0x518ab4('0x21')),_0x277a5b['addColumn'](_0x518ab4('0x1e'),_0x518ab4('0x29'),{'type':_0x3fc3c0[_0x518ab4('0x28')]('in',_0x518ab4('0x34')),'defaultValue':'in','allowNull':![]}),_0x277a5b['query']('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[_0x518ab4('0x1')](_0x518ab4('0x15'),_0x518ab4('0x30'),{'encoding':'utf8'}),fs[_0x518ab4('0x1')](_0x518ab4('0xe'),_0x518ab4('0x35'),{'encoding':'utf8'});let _0x10d773=fs[_0x518ab4('0xa')]('/etc/asterisk/rtp.conf',{'encoding':_0x518ab4('0x31')});_0x10d773=_[_0x518ab4('0x12')](_0x10d773,_0x518ab4('0x20'),_0x518ab4('0x23')),fs['writeFileSync']('/etc/asterisk/rtp.conf',_0x10d773,{'encoding':'utf8'}),fs['appendFileSync'](_0x518ab4('0x36'),'#include\x20\x22stun_xcally.conf\x22',{'encoding':_0x518ab4('0x31')});}catch(_0x113547){logger['info'](JSON['stringify'](_0x113547));}_0x277a5b[_0x518ab4('0x2')](_0x3d5575);});},'down':function(){}};
\ No newline at end of file