Built motion from commit db94841.|2.5.3
[motion2.git] / server / api / sound / sound.rpc.js
index 9b5b793..bff4f76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1466=['raw','where','attributes','include','map','model','ShowSound','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','request\x20sent','debug','error','code','Sound,\x20%s,\x20%s','message','catch','Sound','find','options'];(function(_0x2b6600,_0x24c497){var _0x912ee2=function(_0x5d6484){while(--_0x5d6484){_0x2b6600['push'](_0x2b6600['shift']());}};_0x912ee2(++_0x24c497);}(_0x1466,0xc2));var _0x6146=function(_0x22a0ef,_0x54297a){_0x22a0ef=_0x22a0ef-0x0;var _0x4983f6=_0x1466[_0x22a0ef];return _0x4983f6;};'use strict';var _=require(_0x6146('0x0'));var util=require(_0x6146('0x1'));var moment=require(_0x6146('0x2'));var BPromise=require(_0x6146('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6146('0x4'));var db=require(_0x6146('0x5'))['db'];var utils=require(_0x6146('0x6'));var logger=require(_0x6146('0x7'))(_0x6146('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6146('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2088f1,_0x1daaad,_0x448ec6){return new BPromise(function(_0x35f0fb,_0x4044e9){return client[_0x6146('0xa')](_0x2088f1,_0x448ec6)[_0x6146('0xb')](function(_0x33b131){logger[_0x6146('0xc')]('Sound,\x20%s,\x20%s',_0x1daaad,_0x6146('0xd'));logger[_0x6146('0xe')]('Sound,\x20%s,\x20%s,\x20%s',_0x1daaad,_0x6146('0xd'),JSON['stringify'](_0x33b131));if(_0x33b131[_0x6146('0xf')]){if(_0x33b131[_0x6146('0xf')][_0x6146('0x10')]===0x1f4){logger[_0x6146('0xf')](_0x6146('0x11'),_0x1daaad,_0x33b131['error'][_0x6146('0x12')]);return _0x4044e9(_0x33b131[_0x6146('0xf')][_0x6146('0x12')]);}logger[_0x6146('0xf')](_0x6146('0x11'),_0x1daaad,_0x33b131['error'][_0x6146('0x12')]);return _0x35f0fb(_0x33b131['error'][_0x6146('0x12')]);}else{logger['info']('Sound,\x20%s,\x20%s',_0x1daaad,_0x6146('0xd'));_0x35f0fb(_0x33b131['result'][_0x6146('0x12')]);}})[_0x6146('0x13')](function(_0x30de8d){logger['error'](_0x6146('0x11'),_0x1daaad,_0x30de8d);_0x4044e9(_0x30de8d);});});}exports['ShowSound']=function(_0x538ac6){var _0x463839=this;return new Promise(function(_0x282694,_0x1f3c5a){return db[_0x6146('0x14')][_0x6146('0x15')]({'raw':_0x538ac6['options']?_0x538ac6[_0x6146('0x16')][_0x6146('0x17')]===undefined?!![]:![]:!![],'where':_0x538ac6[_0x6146('0x16')]?_0x538ac6['options'][_0x6146('0x18')]||null:null,'attributes':_0x538ac6['options']?_0x538ac6[_0x6146('0x16')][_0x6146('0x19')]||null:null,'include':_0x538ac6[_0x6146('0x16')]?_0x538ac6[_0x6146('0x16')][_0x6146('0x1a')]?_[_0x6146('0x1b')](_0x538ac6['options'][_0x6146('0x1a')],function(_0x30eda8){return{'model':db[_0x30eda8[_0x6146('0x1c')]],'as':_0x30eda8['as'],'attributes':_0x30eda8[_0x6146('0x19')],'include':_0x30eda8[_0x6146('0x1a')]?_[_0x6146('0x1b')](_0x30eda8[_0x6146('0x1a')],function(_0x75ffc1){return{'model':db[_0x75ffc1[_0x6146('0x1c')]],'as':_0x75ffc1['as'],'attributes':_0x75ffc1['attributes'],'include':_0x75ffc1[_0x6146('0x1a')]?_['map'](_0x75ffc1[_0x6146('0x1a')],function(_0x4a73c3){return{'model':db[_0x4a73c3[_0x6146('0x1c')]],'as':_0x4a73c3['as'],'attributes':_0x4a73c3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x159109){logger[_0x6146('0xc')]('ShowSound',_0x538ac6);logger[_0x6146('0xe')](_0x6146('0x1d'),_0x538ac6,JSON[_0x6146('0x1e')](_0x159109));_0x282694(_0x159109);})[_0x6146('0x13')](function(_0x2f1716){logger[_0x6146('0xf')](_0x6146('0x1d'),_0x2f1716['message'],_0x538ac6);_0x1f3c5a(_0x463839['error'](0x1f4,_0x2f1716[_0x6146('0x12')]));});});};
\ No newline at end of file
+var _0x2b52=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','then','info','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Sound,\x20%s,\x20%s','message','result','catch','ShowSound','Sound','find','options','raw','where','include','attributes','map','model','util'];(function(_0x45e565,_0x3b01d4){var _0x19c10b=function(_0x30e8f5){while(--_0x30e8f5){_0x45e565['push'](_0x45e565['shift']());}};_0x19c10b(++_0x3b01d4);}(_0x2b52,0x15f));var _0x22b5=function(_0x5179a5,_0x419746){_0x5179a5=_0x5179a5-0x0;var _0x15c8ce=_0x2b52[_0x5179a5];return _0x15c8ce;};'use strict';var _=require('lodash');var util=require(_0x22b5('0x0'));var moment=require(_0x22b5('0x1'));var BPromise=require(_0x22b5('0x2'));var rs=require(_0x22b5('0x3'));var fs=require('fs');var Redis=require(_0x22b5('0x4'));var db=require(_0x22b5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x22b5('0x6'));var config=require('../../config/environment');var jayson=require(_0x22b5('0x7'));var client=jayson[_0x22b5('0x8')][_0x22b5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x853e43,_0x2887f4,_0x5bd28d){return new BPromise(function(_0x1146c6,_0x5ed99a){return client['request'](_0x853e43,_0x5bd28d)[_0x22b5('0xa')](function(_0x2bb873){logger[_0x22b5('0xb')]('Sound,\x20%s,\x20%s',_0x2887f4,'request\x20sent');logger[_0x22b5('0xc')](_0x22b5('0xd'),_0x2887f4,_0x22b5('0xe'),JSON[_0x22b5('0xf')](_0x2bb873));if(_0x2bb873[_0x22b5('0x10')]){if(_0x2bb873['error'][_0x22b5('0x11')]===0x1f4){logger[_0x22b5('0x10')](_0x22b5('0x12'),_0x2887f4,_0x2bb873[_0x22b5('0x10')][_0x22b5('0x13')]);return _0x5ed99a(_0x2bb873[_0x22b5('0x10')][_0x22b5('0x13')]);}logger[_0x22b5('0x10')](_0x22b5('0x12'),_0x2887f4,_0x2bb873[_0x22b5('0x10')][_0x22b5('0x13')]);return _0x1146c6(_0x2bb873[_0x22b5('0x10')]['message']);}else{logger['info'](_0x22b5('0x12'),_0x2887f4,_0x22b5('0xe'));_0x1146c6(_0x2bb873[_0x22b5('0x14')][_0x22b5('0x13')]);}})[_0x22b5('0x15')](function(_0xe71a0c){logger['error'](_0x22b5('0x12'),_0x2887f4,_0xe71a0c);_0x5ed99a(_0xe71a0c);});});}exports[_0x22b5('0x16')]=function(_0x132152){var _0x5e917a=this;return new Promise(function(_0x6c0dc2,_0x37733a){return db[_0x22b5('0x17')][_0x22b5('0x18')]({'raw':_0x132152[_0x22b5('0x19')]?_0x132152[_0x22b5('0x19')][_0x22b5('0x1a')]===undefined?!![]:![]:!![],'where':_0x132152[_0x22b5('0x19')]?_0x132152[_0x22b5('0x19')][_0x22b5('0x1b')]||null:null,'attributes':_0x132152['options']?_0x132152[_0x22b5('0x19')]['attributes']||null:null,'include':_0x132152[_0x22b5('0x19')]?_0x132152['options'][_0x22b5('0x1c')]?_['map'](_0x132152[_0x22b5('0x19')][_0x22b5('0x1c')],function(_0x43c13a){return{'model':db[_0x43c13a['model']],'as':_0x43c13a['as'],'attributes':_0x43c13a[_0x22b5('0x1d')],'include':_0x43c13a[_0x22b5('0x1c')]?_[_0x22b5('0x1e')](_0x43c13a[_0x22b5('0x1c')],function(_0x45ed21){return{'model':db[_0x45ed21[_0x22b5('0x1f')]],'as':_0x45ed21['as'],'attributes':_0x45ed21[_0x22b5('0x1d')],'include':_0x45ed21[_0x22b5('0x1c')]?_[_0x22b5('0x1e')](_0x45ed21[_0x22b5('0x1c')],function(_0x3d94da){return{'model':db[_0x3d94da[_0x22b5('0x1f')]],'as':_0x3d94da['as'],'attributes':_0x3d94da[_0x22b5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x22b5('0xa')](function(_0x1ab23c){logger[_0x22b5('0xb')]('ShowSound',_0x132152);logger['debug'](_0x22b5('0x16'),_0x132152,JSON[_0x22b5('0xf')](_0x1ab23c));_0x6c0dc2(_0x1ab23c);})['catch'](function(_0xb18e0f){logger[_0x22b5('0x10')](_0x22b5('0x16'),_0xb18e0f[_0x22b5('0x13')],_0x132152);_0x37733a(_0x5e917a[_0x22b5('0x10')](0x1f4,_0xb18e0f[_0x22b5('0x13')]));});});};
\ No newline at end of file