Built motion from commit b51cdcb3f2cb46634587ce1d55ea1b8f32dacea6. Version 3.0.0...
[motion-next.git] / server / migrations / 2.0.50.js
1 const a929_0x15c4=['predictive','preview','then','queryInterface','finally','progressive','removeColumn','catch','sequence','Added\x20column\x20%s\x20to\x20%s','Removed\x20column\x20%s\x20from\x20%s','dialMethod','messageId','addColumn','DELETE\x20FROM\x20`voice_extensions`\x20WHERE\x20`exten`=\x27xcally-motion-preview\x27\x20AND\x20`priority`=\x206','../config/logger','prototype','addIndex\x20%s\x20%s\x20%s','query','ENUM','Changed\x20column\x20%s\x20in\x20table\x20%s','addIndex','changeColumn','table\x20dropped\x20%s','join','stringify','voice_queues','dropTable','util','tail','enqueue','STRING','inspect','booked','final','info'];(function(_0x45342c,_0x15c418){const _0x19099e=function(_0x96fa3e){while(--_0x96fa3e){_0x45342c['push'](_0x45342c['shift']());}};_0x19099e(++_0x15c418);}(a929_0x15c4,0xf8));const a929_0x1909=function(_0x45342c,_0x15c418){_0x45342c=_0x45342c-0x0;let _0x19099e=a929_0x15c4[_0x45342c];return _0x19099e;};const _0x55faaa=a929_0x1909;'use strict';const util=require(_0x55faaa('0x20')),logger=require(_0x55faaa('0x13'))('migration'),Sequence=function(){};Sequence['prototype'][_0x55faaa('0x22')]=function(_0x96fa3e){const _0x1577ee=_0x55faaa;this['tail']=this[_0x1577ee('0x21')]?this['tail'][_0x1577ee('0x8')](_0x96fa3e):_0x96fa3e();};const Migration=function(_0x2c5d64){this['queryInterface']=_0x2c5d64,this['sequence']=new Sequence();};Migration[_0x55faaa('0x14')][_0x55faaa('0x1a')]=function(_0x4db3ba,_0x5109e8,_0x13713c){const _0x304738=_0x55faaa,_0x2f5598=this;this[_0x304738('0xc')]['enqueue'](function(){const _0x1d6d63=_0x304738;return _0x2f5598[_0x1d6d63('0x7')][_0x1d6d63('0x1a')](_0x4db3ba,_0x5109e8,_0x13713c)['then'](function(){const _0x3766e3=_0x1d6d63;logger[_0x3766e3('0x3')](_0x3766e3('0x18'),_0x5109e8,_0x4db3ba);})['catch'](function(_0x4223f0){const _0x4051e8=_0x1d6d63;logger[_0x4051e8('0x3')](JSON[_0x4051e8('0x1d')](_0x4223f0));});});},Migration[_0x55faaa('0x14')][_0x55faaa('0x11')]=function(_0x3e81f3,_0x818cf5,_0xa6e3e5){const _0x2ec223=_0x55faaa,_0x3257b2=this;this[_0x2ec223('0xc')][_0x2ec223('0x22')](function(){const _0x11863d=_0x2ec223;return _0x3257b2[_0x11863d('0x7')][_0x11863d('0x11')](_0x3e81f3,_0x818cf5,_0xa6e3e5)[_0x11863d('0x6')](function(){const _0x2e2080=_0x11863d;logger[_0x2e2080('0x3')](_0x2e2080('0xd'),_0x818cf5,_0x3e81f3);})[_0x11863d('0xb')](function(_0x29a61d){const _0x2f3402=_0x11863d;logger[_0x2f3402('0x3')](JSON['stringify'](_0x29a61d));});});},Migration[_0x55faaa('0x14')][_0x55faaa('0x1f')]=function(_0x397a92){const _0x458313=_0x55faaa,_0x236805=this;this[_0x458313('0xc')][_0x458313('0x22')](function(){const _0x3459a6=_0x458313;return _0x236805[_0x3459a6('0x7')][_0x3459a6('0x1f')](_0x397a92,{'force':!![]})[_0x3459a6('0x6')](function(){const _0x57d040=_0x3459a6;logger[_0x57d040('0x3')](_0x57d040('0x1b'),_0x397a92);})[_0x3459a6('0xb')](function(_0x4a6453){const _0x3c769e=_0x3459a6;logger[_0x3c769e('0x3')](JSON[_0x3c769e('0x1d')](_0x4a6453));});});},Migration[_0x55faaa('0x14')]['addIndex']=function(_0x32c9fc,_0x10b29b,_0xa457df){const _0x3cfe2d=_0x55faaa,_0x3278ac=this;this[_0x3cfe2d('0xc')][_0x3cfe2d('0x22')](function(){const _0x1fd219=_0x3cfe2d;return _0x3278ac[_0x1fd219('0x7')][_0x1fd219('0x19')](_0x32c9fc,_0x10b29b,{'indexName':_0xa457df})['then'](function(){const _0x1fab70=_0x1fd219;logger[_0x1fab70('0x3')](_0x1fab70('0x15'),_0x32c9fc,_0x10b29b[_0x1fab70('0x1c')](','),_0xa457df);})[_0x1fd219('0xb')](function(_0x785b4e){const _0x1a2938=_0x1fd219;logger[_0x1a2938('0x3')](JSON[_0x1a2938('0x1d')](_0x785b4e));});});},Migration['prototype'][_0x55faaa('0x16')]=function(_0x488c43){const _0x833470=_0x55faaa,_0x4cdaad=this;this[_0x833470('0xc')]['enqueue'](function(){const _0x430fb9=_0x833470;return _0x4cdaad[_0x430fb9('0x7')]['sequelize'][_0x430fb9('0x16')](_0x488c43)[_0x430fb9('0x6')](function(){const _0x9966fe=_0x430fb9;logger[_0x9966fe('0x3')]('query\x20%s',_0x488c43);})[_0x430fb9('0xb')](function(_0x457449){const _0x4ca0ee=_0x430fb9;logger[_0x4ca0ee('0x3')](JSON[_0x4ca0ee('0x1d')](_0x457449));});});},Migration[_0x55faaa('0x14')][_0x55faaa('0xa')]=function(_0xcd48e1,_0xb64546){const _0x43dda8=_0x55faaa,_0x18e10e=this;this[_0x43dda8('0xc')]['enqueue'](function(){const _0x16001e=_0x43dda8;return _0x18e10e[_0x16001e('0x7')]['removeColumn'](_0xcd48e1,_0xb64546)[_0x16001e('0x6')](function(){const _0x15aa25=_0x16001e;logger[_0x15aa25('0x3')](_0x15aa25('0xe'),_0xb64546,_0xcd48e1);})[_0x16001e('0xb')](function(_0x31916e){const _0x12f309=_0x16001e;logger[_0x12f309('0x3')](util[_0x12f309('0x0')](_0x31916e,{'showHidden':![],'depth':null}));});});},Migration[_0x55faaa('0x14')][_0x55faaa('0x2')]=function(_0xea589e){const _0x300693=_0x55faaa;this[_0x300693('0xc')][_0x300693('0x22')](function(){return _0xea589e();});},module['exports']={'up':function(_0xc8f9fa,_0x28ed67){return new Promise(function(_0x55e493){const _0x1f4f15=a929_0x1909,_0x5cebcb=new Migration(_0xc8f9fa);_0x5cebcb['changeColumn']('sms_messages',_0x1f4f15('0x10'),{'type':_0x28ed67[_0x1f4f15('0x23')](0xbe)}),_0x5cebcb['addIndex']('sms_messages',[_0x1f4f15('0x10')],_0x1f4f15('0x10')),_0x5cebcb[_0x1f4f15('0x1a')](_0x1f4f15('0x1e'),_0x1f4f15('0xf'),{'type':_0x28ed67[_0x1f4f15('0x17')](_0x1f4f15('0x5'),_0x1f4f15('0x9'),'power',_0x1f4f15('0x4'),_0x1f4f15('0x1')),'defaultValue':_0x1f4f15('0x9')}),_0x5cebcb[_0x1f4f15('0x16')](_0x1f4f15('0x12')),_0x5cebcb['query']('INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`appdata`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-preview\x27,\x20\x276\x27,\x20\x27Execif\x27,\x20\x27$[\x22${XMD-AGIAFTER}\x22\x20!=\x20\x22NONE\x22\x20]?AGI(${XMD-AGIAFTER})\x27,\x20\x27system\x27,\x20\x27dialer\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());'),_0x5cebcb[_0x1f4f15('0x16')]('INSERT\x20INTO\x20`voice_extensions`\x20(`context`,\x20`exten`,\x20`priority`,\x20`app`,\x20`type`,\x20`description`,\x20`createdAt`,\x20`updatedAt`)\x20VALUES\x20(\x27from-sip\x27,\x20\x27xcally-motion-preview\x27,\x20\x277\x27,\x20\x27hangup\x27,\x20\x27system\x27,\x20\x27dialer\x20extensions\x20auto\x20generated\x27,\x20NOW(),\x20NOW());'),_0x5cebcb[_0x1f4f15('0x2')](_0x55e493);});},'down':function(){}};