Built motion from commit (unavailable).|2.5.30
[motion2.git] / server / api / version / version.controller.js
index d8aa935..4543fd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5800=['getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','child_process','exec','../../config/environment','update','simple-git','index','exports','query','latest','fetch','tags','status','json','origin','master','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','root','server','migrations','length','replace','.js','push','sort','sequelize','Migration'];(function(_0x5ea22f,_0x128142){var _0x4d878c=function(_0x334e3c){while(--_0x334e3c){_0x5ea22f['push'](_0x5ea22f['shift']());}};_0x4d878c(++_0x128142);}(_0x5800,0x1b9));var _0x0580=function(_0x55d11b,_0x11f7de){_0x55d11b=_0x55d11b-0x0;var _0x145d2b=_0x5800[_0x55d11b];return _0x145d2b;};'use strict';var Umzug=require('umzug');var path=require(_0x0580('0x0'));var fs=require('fs');var _=require(_0x0580('0x1'));var pkginfo=require(_0x0580('0x2'))(module,_0x0580('0x3'));var compareVersions=require('compare-versions');var exec=require(_0x0580('0x4'))[_0x0580('0x5')];var db=require('../../mysqldb')['db'];var config=require(_0x0580('0x6'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0x0580('0x7'));var git=require(_0x0580('0x8'))(config['root']);exports[_0x0580('0x9')]=function(_0x5c4ab8,_0x1e4b42){var _0x51bb48={'current':module[_0x0580('0xa')][_0x0580('0x3')],'phonebar':0x2};if(_0x5c4ab8[_0x0580('0xb')]&&_0x5c4ab8[_0x0580('0xb')][_0x0580('0xc')]){return git[_0x0580('0xd')]()[_0x0580('0xe')](function(_0x1edc39,_0x4a6786){_0x51bb48[_0x0580('0xc')]=(_0x1edc39?module[_0x0580('0xa')][_0x0580('0x3')]:_0x4a6786['latest'])||'2.0.0';return _0x1e4b42[_0x0580('0xf')](0xc8)[_0x0580('0x10')](_0x51bb48);});}else{return _0x1e4b42[_0x0580('0xf')](0xc8)['json'](_0x51bb48);}};exports[_0x0580('0xd')]=function(_0x41ec01,_0x45d8b2){return git['fetch']([_0x0580('0x11'),_0x0580('0x12')],function(_0x473bcd){if(_0x473bcd){logger[_0x0580('0x13')](_0x473bcd);return _0x45d8b2[_0x0580('0xf')](0x1f4)[_0x0580('0x10')](_0x473bcd);}logger[_0x0580('0x14')]('git\x20fetch');return _0x45d8b2[_0x0580('0xf')](0xc8)[_0x0580('0x10')]({'output':_0x0580('0x15')});});};exports[_0x0580('0x16')]=function(_0x18739d,_0x549e64){return git[_0x0580('0x16')]([_0x0580('0x17'),_0x0580('0x18')],function(_0x5b3db9){if(_0x5b3db9){logger[_0x0580('0x13')](_0x5b3db9);return _0x549e64[_0x0580('0xf')](0x1f4)[_0x0580('0x10')](_0x5b3db9);}logger[_0x0580('0x14')](_0x0580('0x19'));return _0x549e64[_0x0580('0xf')](0xc8)[_0x0580('0x10')]({'output':'git\x20reset\x20--hard'});});};exports[_0x0580('0x1a')]=function(_0x3c9415,_0xab9d36){exec(_0x0580('0x1b'),function(_0x23cfa8,_0x36f360,_0x180fc3){logger[_0x0580('0x14')](_0x36f360);logger[_0x0580('0x14')](_0x180fc3);if(_0x23cfa8){logger[_0x0580('0x13')](_0x23cfa8);return _0xab9d36[_0x0580('0xf')](0x1f4)[_0x0580('0x10')](_0x23cfa8);}return _0xab9d36[_0x0580('0xf')](0xc8)['json']({'output':_0x36f360});});};exports['restart']=function(_0x137ac6,_0x5ee76e){return pm2[_0x0580('0x1c')](_0x0580('0x1d'))[_0x0580('0x1e')](function(_0x1833db){logger[_0x0580('0x14')](_0x0580('0x1f'),_0x1833db);return _0x5ee76e[_0x0580('0xf')](0xc8)[_0x0580('0x10')]({'output':_0x0580('0x20')});})[_0x0580('0x21')](function(_0x22a5c2){logger['error'](_0x22a5c2);return _0x5ee76e[_0x0580('0xf')](0x1f4)[_0x0580('0x10')](_0x22a5c2);});};exports['migrations']=function(_0x36333e,_0x2720f3){var _0xae8068=fs[_0x0580('0x22')](path['join'](config[_0x0580('0x23')],_0x0580('0x24'),_0x0580('0x25')));var _0x457f1b=[];for(var _0x2522df=0x0;_0x2522df<_0xae8068[_0x0580('0x26')];_0x2522df++){var _0x3429ed=_0xae8068[_0x2522df][_0x0580('0x27')](_0x0580('0x28'),'');if(compareVersions(module[_0x0580('0xa')][_0x0580('0x3')],_0x3429ed)===-0x1){_0x457f1b[_0x0580('0x29')](_0x3429ed);}}if(_0x457f1b['length']){var _0x5227ed=_0x457f1b[_0x0580('0x2a')](compareVersions);var _0x1eaef0=new Umzug({'storage':_0x0580('0x2b'),'storageOptions':{'model':db[_0x0580('0x2c')],'modelName':_0x0580('0x2c'),'columnName':_0x0580('0x3')},'migrations':{'params':[db[_0x0580('0x2b')][_0x0580('0x2d')](),db[_0x0580('0x2b')]['constructor'],function(){throw new Error(_0x0580('0x2e'));}],'path':path[_0x0580('0x2f')](config[_0x0580('0x23')],_0x0580('0x24'),_0x0580('0x25')),'pattern':/\.js$/}});_0x1eaef0['up']({'migrations':_[_0x0580('0x30')](_0x5227ed,function(_0x4ce695){return _0x4ce695+_0x0580('0x28');})})['then'](function(){return _0x2720f3['status'](0xc8)[_0x0580('0x10')]({'output':_0x0580('0x31')+module[_0x0580('0xa')][_0x0580('0x3')]+_0x0580('0x32')+_[_0x0580('0x33')](_0x5227ed),'migrations':_['join'](_0x5227ed)});})[_0x0580('0x21')](function(_0xb89e6c){if(_0xb89e6c instanceof db[_0x0580('0x2b')][_0x0580('0x34')]){return _0x2720f3['status'](0xc8)[_0x0580('0x10')]({'output':_0x0580('0x35')});}else{return _0x2720f3['status'](0x1f4)[_0x0580('0x10')](_0xb89e6c);}});}else{return _0x2720f3[_0x0580('0xf')](0xc8)[_0x0580('0x10')]({'output':'Database\x20already\x20up-to-date'});}};
\ No newline at end of file
+var _0xa817=['readdirSync','server','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','join','\x20to\x20','last','catch','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','simple-git','root','index','latest','tags','exports','status','json','fetch','origin','master','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','error','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations'];(function(_0xd186f3,_0x2351e4){var _0x327337=function(_0x2030df){while(--_0x2030df){_0xd186f3['push'](_0xd186f3['shift']());}};_0x327337(++_0x2351e4);}(_0xa817,0x7b));var _0x7a81=function(_0x11f7e4,_0x195c63){_0x11f7e4=_0x11f7e4-0x0;var _0x2bc69b=_0xa817[_0x11f7e4];return _0x2bc69b;};'use strict';var Umzug=require(_0x7a81('0x0'));var path=require(_0x7a81('0x1'));var fs=require('fs');var _=require(_0x7a81('0x2'));var pkginfo=require(_0x7a81('0x3'))(module,_0x7a81('0x4'));var compareVersions=require(_0x7a81('0x5'));var exec=require(_0x7a81('0x6'))[_0x7a81('0x7')];var db=require(_0x7a81('0x8'))['db'];var config=require('../../config/environment');var pm2=require(_0x7a81('0x9'));var logger=require(_0x7a81('0xa'))('update');var git=require(_0x7a81('0xb'))(config[_0x7a81('0xc')]);exports[_0x7a81('0xd')]=function(_0x705d4e,_0x1869fb){var _0x18f6f6={'current':module['exports'][_0x7a81('0x4')],'phonebar':0x2};if(_0x705d4e['query']&&_0x705d4e['query'][_0x7a81('0xe')]){return git['fetch']()[_0x7a81('0xf')](function(_0x37fee1,_0xcf4b61){_0x18f6f6[_0x7a81('0xe')]=(_0x37fee1?module[_0x7a81('0x10')][_0x7a81('0x4')]:_0xcf4b61[_0x7a81('0xe')])||'2.0.0';return _0x1869fb[_0x7a81('0x11')](0xc8)[_0x7a81('0x12')](_0x18f6f6);});}else{return _0x1869fb[_0x7a81('0x11')](0xc8)['json'](_0x18f6f6);}};exports[_0x7a81('0x13')]=function(_0xd1e099,_0x2977a9){return git[_0x7a81('0x13')]([_0x7a81('0x14'),_0x7a81('0x15')],function(_0x54507c){if(_0x54507c){logger['error'](_0x54507c);return _0x2977a9[_0x7a81('0x11')](0x1f4)[_0x7a81('0x12')](_0x54507c);}logger['info'](_0x7a81('0x16'));return _0x2977a9[_0x7a81('0x11')](0xc8)[_0x7a81('0x12')]({'output':_0x7a81('0x17')});});};exports[_0x7a81('0x18')]=function(_0x3bec25,_0x114cfa){return git[_0x7a81('0x18')]([_0x7a81('0x19'),_0x7a81('0x1a')],function(_0x3c3c59){if(_0x3c3c59){logger[_0x7a81('0x1b')](_0x3c3c59);return _0x114cfa[_0x7a81('0x11')](0x1f4)['json'](_0x3c3c59);}logger[_0x7a81('0x1c')](_0x7a81('0x1d'));return _0x114cfa[_0x7a81('0x11')](0xc8)[_0x7a81('0x12')]({'output':_0x7a81('0x1e')});});};exports[_0x7a81('0x1f')]=function(_0x34dd0b,_0x374f02){exec(_0x7a81('0x20'),function(_0x596a8c,_0x3c0c41,_0x26b384){logger[_0x7a81('0x1c')](_0x3c0c41);logger[_0x7a81('0x1c')](_0x26b384);if(_0x596a8c){logger[_0x7a81('0x1b')](_0x596a8c);return _0x374f02[_0x7a81('0x11')](0x1f4)[_0x7a81('0x12')](_0x596a8c);}return _0x374f02[_0x7a81('0x11')](0xc8)['json']({'output':_0x3c0c41});});};exports[_0x7a81('0x21')]=function(_0x574208,_0x5a472e){return pm2[_0x7a81('0x21')](_0x7a81('0x22'))[_0x7a81('0x23')](function(_0x545b79){logger[_0x7a81('0x1c')](_0x7a81('0x24'),_0x545b79);return _0x5a472e[_0x7a81('0x11')](0xc8)[_0x7a81('0x12')]({'output':_0x7a81('0x25')});})['catch'](function(_0x38de7c){logger[_0x7a81('0x1b')](_0x38de7c);return _0x5a472e[_0x7a81('0x11')](0x1f4)[_0x7a81('0x12')](_0x38de7c);});};exports[_0x7a81('0x26')]=function(_0x3295df,_0x31fe26){var _0x551c14=fs[_0x7a81('0x27')](path['join'](config[_0x7a81('0xc')],_0x7a81('0x28'),_0x7a81('0x26')));var _0x523d39=[];for(var _0x3f7e20=0x0;_0x3f7e20<_0x551c14['length'];_0x3f7e20++){var _0x5e9589=_0x551c14[_0x3f7e20][_0x7a81('0x29')](_0x7a81('0x2a'),'');if(compareVersions(module[_0x7a81('0x10')][_0x7a81('0x4')],_0x5e9589)===-0x1){_0x523d39[_0x7a81('0x2b')](_0x5e9589);}}if(_0x523d39['length']){var _0x39cbe9=_0x523d39[_0x7a81('0x2c')](compareVersions);var _0x1fff42=new Umzug({'storage':_0x7a81('0x2d'),'storageOptions':{'model':db[_0x7a81('0x2e')],'modelName':_0x7a81('0x2e'),'columnName':_0x7a81('0x4')},'migrations':{'params':[db['sequelize'][_0x7a81('0x2f')](),db[_0x7a81('0x2d')][_0x7a81('0x30')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x7a81('0x31')](config[_0x7a81('0xc')],_0x7a81('0x28'),_0x7a81('0x26')),'pattern':/\.js$/}});_0x1fff42['up']({'migrations':_['map'](_0x39cbe9,function(_0x13a0d6){return _0x13a0d6+_0x7a81('0x2a');})})[_0x7a81('0x23')](function(){return _0x31fe26[_0x7a81('0x11')](0xc8)[_0x7a81('0x12')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x7a81('0x10')][_0x7a81('0x4')]+_0x7a81('0x32')+_[_0x7a81('0x33')](_0x39cbe9),'migrations':_[_0x7a81('0x31')](_0x39cbe9)});})[_0x7a81('0x34')](function(_0x399d66){if(_0x399d66 instanceof db['sequelize']['UniqueConstraintError']){return _0x31fe26[_0x7a81('0x11')](0xc8)[_0x7a81('0x12')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x31fe26[_0x7a81('0x11')](0x1f4)[_0x7a81('0x12')](_0x399d66);}});}else{return _0x31fe26[_0x7a81('0x11')](0xc8)['json']({'output':_0x7a81('0x35')});}};
\ No newline at end of file