Built motion from commit e0fa946e.|2.6.5
[motion2.git] / server / api / voiceExtension / voiceExtension.rpc.js
index d3c0b10..d9f2d98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x873a=['error','code','VoiceExtension,\x20%s,\x20%s','message','catch','GetVoiceExtension','VoiceExtension','options','raw','limit','attributes','include','model','map','then','info','debug','stringify','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x873a,0x1c2));var _0xa873=function(_0x3acf0f,_0x4736ac){_0x3acf0f=_0x3acf0f-0x0;var _0x48cf9f=_0x873a[_0x3acf0f];return _0x48cf9f;};'use strict';var _=require(_0xa873('0x0'));var util=require(_0xa873('0x1'));var moment=require(_0xa873('0x2'));var BPromise=require('bluebird');var rs=require(_0xa873('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa873('0x4'));var logger=require(_0xa873('0x5'))('rpc');var config=require(_0xa873('0x6'));var jayson=require(_0xa873('0x7'));var client=jayson['client'][_0xa873('0x8')]({'port':0x232a});config['redis']=_[_0xa873('0x9')](config[_0xa873('0xa')],{'host':_0xa873('0xb'),'port':0x18eb});var socket=require(_0xa873('0xc'))(new Redis(config[_0xa873('0xa')]));require(_0xa873('0xd'))[_0xa873('0xe')](socket);function respondWithRpcPromise(_0x10b82b,_0x44fa49,_0x23c1fa){return new BPromise(function(_0xc2fb4f,_0x4d0270){return client[_0xa873('0xf')](_0x10b82b,_0x23c1fa)['then'](function(_0x2573c9){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x44fa49,_0xa873('0x10'));logger['debug'](_0xa873('0x11'),_0x44fa49,_0xa873('0x10'),JSON['stringify'](_0x2573c9));if(_0x2573c9[_0xa873('0x12')]){if(_0x2573c9[_0xa873('0x12')][_0xa873('0x13')]===0x1f4){logger['error'](_0xa873('0x14'),_0x44fa49,_0x2573c9[_0xa873('0x12')][_0xa873('0x15')]);return _0x4d0270(_0x2573c9['error'][_0xa873('0x15')]);}logger[_0xa873('0x12')](_0xa873('0x14'),_0x44fa49,_0x2573c9['error'][_0xa873('0x15')]);return _0xc2fb4f(_0x2573c9['error'][_0xa873('0x15')]);}else{logger['info'](_0xa873('0x14'),_0x44fa49,_0xa873('0x10'));_0xc2fb4f(_0x2573c9['result'][_0xa873('0x15')]);}})[_0xa873('0x16')](function(_0x34e859){logger['error'](_0xa873('0x14'),_0x44fa49,_0x34e859);_0x4d0270(_0x34e859);});});}exports[_0xa873('0x17')]=function(_0x5af77c){var _0x348492=this;return new Promise(function(_0x2b9238,_0x2e2d5a){return db[_0xa873('0x18')]['findAll']({'raw':_0x5af77c[_0xa873('0x19')]?_0x5af77c[_0xa873('0x19')][_0xa873('0x1a')]===undefined?!![]:![]:!![],'where':_0x5af77c[_0xa873('0x19')]?_0x5af77c[_0xa873('0x19')]['where']||null:null,'attributes':_0x5af77c[_0xa873('0x19')]?_0x5af77c[_0xa873('0x19')]['attributes']||null:null,'limit':_0x5af77c[_0xa873('0x19')]?_0x5af77c['options'][_0xa873('0x1b')]||null:null,'include':_0x5af77c[_0xa873('0x19')]?_0x5af77c[_0xa873('0x19')]['include']?_['map'](_0x5af77c[_0xa873('0x19')]['include'],function(_0x4326f6){return{'model':db[_0x4326f6['model']],'as':_0x4326f6['as'],'attributes':_0x4326f6[_0xa873('0x1c')],'include':_0x4326f6[_0xa873('0x1d')]?_['map'](_0x4326f6[_0xa873('0x1d')],function(_0x9ca1dc){return{'model':db[_0x9ca1dc[_0xa873('0x1e')]],'as':_0x9ca1dc['as'],'attributes':_0x9ca1dc[_0xa873('0x1c')],'include':_0x9ca1dc[_0xa873('0x1d')]?_[_0xa873('0x1f')](_0x9ca1dc[_0xa873('0x1d')],function(_0xae680){return{'model':db[_0xae680[_0xa873('0x1e')]],'as':_0xae680['as'],'attributes':_0xae680[_0xa873('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa873('0x20')](function(_0xcdae11){logger[_0xa873('0x21')](_0xa873('0x17'),_0x5af77c);logger[_0xa873('0x22')](_0xa873('0x17'),_0x5af77c,JSON[_0xa873('0x23')](_0xcdae11));_0x2b9238(_0xcdae11);})[_0xa873('0x16')](function(_0x222d28){logger[_0xa873('0x12')](_0xa873('0x17'),_0x222d28[_0xa873('0x15')],_0x5af77c);_0x2e2d5a(_0x348492[_0xa873('0x12')](0x1f4,_0x222d28[_0xa873('0x15')]));});});};
\ No newline at end of file
+var _0x1883=['code','message','VoiceExtension,\x20%s,\x20%s','info','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','map','include','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','then','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1883,0xab));var _0x3188=function(_0xf394d3,_0x4271dc){_0xf394d3=_0xf394d3-0x0;var _0x51462b=_0x1883[_0xf394d3];return _0x51462b;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var moment=require(_0x3188('0x2'));var BPromise=require(_0x3188('0x3'));var rs=require(_0x3188('0x4'));var fs=require('fs');var Redis=require(_0x3188('0x5'));var db=require(_0x3188('0x6'))['db'];var utils=require(_0x3188('0x7'));var logger=require(_0x3188('0x8'))(_0x3188('0x9'));var config=require(_0x3188('0xa'));var jayson=require(_0x3188('0xb'));var client=jayson[_0x3188('0xc')][_0x3188('0xd')]({'port':0x232a});config[_0x3188('0xe')]=_[_0x3188('0xf')](config[_0x3188('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x3188('0x10'))(new Redis(config[_0x3188('0xe')]));require('./voiceExtension.socket')[_0x3188('0x11')](socket);function respondWithRpcPromise(_0x5b7f47,_0xc6040,_0x34fc82){return new BPromise(function(_0x209e31,_0x43b69){return client['request'](_0x5b7f47,_0x34fc82)[_0x3188('0x12')](function(_0x2cdcb2){logger['info']('VoiceExtension,\x20%s,\x20%s',_0xc6040,_0x3188('0x13'));logger[_0x3188('0x14')](_0x3188('0x15'),_0xc6040,_0x3188('0x13'),JSON[_0x3188('0x16')](_0x2cdcb2));if(_0x2cdcb2[_0x3188('0x17')]){if(_0x2cdcb2['error'][_0x3188('0x18')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0xc6040,_0x2cdcb2[_0x3188('0x17')]['message']);return _0x43b69(_0x2cdcb2['error'][_0x3188('0x19')]);}logger[_0x3188('0x17')](_0x3188('0x1a'),_0xc6040,_0x2cdcb2[_0x3188('0x17')][_0x3188('0x19')]);return _0x209e31(_0x2cdcb2[_0x3188('0x17')]['message']);}else{logger[_0x3188('0x1b')](_0x3188('0x1a'),_0xc6040,_0x3188('0x13'));_0x209e31(_0x2cdcb2[_0x3188('0x1c')][_0x3188('0x19')]);}})[_0x3188('0x1d')](function(_0xac7f48){logger[_0x3188('0x17')]('VoiceExtension,\x20%s,\x20%s',_0xc6040,_0xac7f48);_0x43b69(_0xac7f48);});});}exports[_0x3188('0x1e')]=function(_0x36050a){var _0x5512f4=this;return new Promise(function(_0x518b2f,_0x5d8d62){return db[_0x3188('0x1f')][_0x3188('0x20')]({'raw':_0x36050a[_0x3188('0x21')]?_0x36050a['options']['raw']===undefined?!![]:![]:!![],'where':_0x36050a[_0x3188('0x21')]?_0x36050a[_0x3188('0x21')][_0x3188('0x22')]||null:null,'attributes':_0x36050a[_0x3188('0x21')]?_0x36050a[_0x3188('0x21')]['attributes']||null:null,'limit':_0x36050a[_0x3188('0x21')]?_0x36050a[_0x3188('0x21')]['limit']||null:null,'include':_0x36050a[_0x3188('0x21')]?_0x36050a['options']['include']?_[_0x3188('0x23')](_0x36050a[_0x3188('0x21')][_0x3188('0x24')],function(_0x1aeaba){return{'model':db[_0x1aeaba[_0x3188('0x25')]],'as':_0x1aeaba['as'],'attributes':_0x1aeaba[_0x3188('0x26')],'include':_0x1aeaba[_0x3188('0x24')]?_[_0x3188('0x23')](_0x1aeaba['include'],function(_0x2cc5d9){return{'model':db[_0x2cc5d9[_0x3188('0x25')]],'as':_0x2cc5d9['as'],'attributes':_0x2cc5d9['attributes'],'include':_0x2cc5d9[_0x3188('0x24')]?_[_0x3188('0x23')](_0x2cc5d9[_0x3188('0x24')],function(_0x44db9a){return{'model':db[_0x44db9a[_0x3188('0x25')]],'as':_0x44db9a['as'],'attributes':_0x44db9a[_0x3188('0x26')]};}):[]};}):[]};}):[]:[]})[_0x3188('0x12')](function(_0x472926){logger['info'](_0x3188('0x1e'),_0x36050a);logger['debug'](_0x3188('0x1e'),_0x36050a,JSON['stringify'](_0x472926));_0x518b2f(_0x472926);})[_0x3188('0x1d')](function(_0x80f9a8){logger[_0x3188('0x17')](_0x3188('0x1e'),_0x80f9a8[_0x3188('0x19')],_0x36050a);_0x5d8d62(_0x5512f4[_0x3188('0x17')](0x1f4,_0x80f9a8[_0x3188('0x19')]));});});};
\ No newline at end of file