Built motion from commit 06eb8eb0.|2.6.31
[motion2.git] / server / api / faxInteraction / faxInteraction.rpc.js
index 2dd2e01..d98058d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc29a=['AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','info','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','result','FaxInteraction','body','options','where','attributes','then','UpdateFaxInteraction','catch','AddTagsToFaxInteraction','find','ids'];(function(_0x39b55a,_0x342d1c){var _0x384124=function(_0x5f2506){while(--_0x5f2506){_0x39b55a['push'](_0x39b55a['shift']());}};_0x384124(++_0x342d1c);}(_0xc29a,0xce));var _0xac29=function(_0x16021d,_0x207219){_0x16021d=_0x16021d-0x0;var _0x56e4dd=_0xc29a[_0x16021d];return _0x56e4dd;};'use strict';var _=require(_0xac29('0x0'));var util=require(_0xac29('0x1'));var moment=require(_0xac29('0x2'));var BPromise=require(_0xac29('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac29('0x4'));var db=require(_0xac29('0x5'))['db'];var utils=require(_0xac29('0x6'));var logger=require(_0xac29('0x7'))('rpc');var config=require(_0xac29('0x8'));var jayson=require(_0xac29('0x9'));var client=jayson[_0xac29('0xa')][_0xac29('0xb')]({'port':0x232a});config[_0xac29('0xc')]=_[_0xac29('0xd')](config[_0xac29('0xc')],{'host':_0xac29('0xe'),'port':0x18eb});var socket=require(_0xac29('0xf'))(new Redis(config[_0xac29('0xc')]));require(_0xac29('0x10'))[_0xac29('0x11')](socket);function respondWithRpcPromise(_0x344c50,_0x111804,_0x200bbb){return new BPromise(function(_0xf4e62b,_0x3e0d1e){return client[_0xac29('0x12')](_0x344c50,_0x200bbb)['then'](function(_0x31d745){logger[_0xac29('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x111804,'request\x20sent');logger[_0xac29('0x14')](_0xac29('0x15'),_0x111804,_0xac29('0x16'),JSON[_0xac29('0x17')](_0x31d745));if(_0x31d745[_0xac29('0x18')]){if(_0x31d745[_0xac29('0x18')][_0xac29('0x19')]===0x1f4){logger[_0xac29('0x18')](_0xac29('0x1a'),_0x111804,_0x31d745['error'][_0xac29('0x1b')]);return _0x3e0d1e(_0x31d745['error'][_0xac29('0x1b')]);}logger[_0xac29('0x18')](_0xac29('0x1a'),_0x111804,_0x31d745['error']['message']);return _0xf4e62b(_0x31d745['error']['message']);}else{logger[_0xac29('0x13')](_0xac29('0x1a'),_0x111804,_0xac29('0x16'));_0xf4e62b(_0x31d745[_0xac29('0x1c')]['message']);}})['catch'](function(_0x4597c4){logger[_0xac29('0x18')](_0xac29('0x1a'),_0x111804,_0x4597c4);_0x3e0d1e(_0x4597c4);});});}exports['UpdateFaxInteraction']=function(_0xaffccf){var _0x541744=this;return new Promise(function(_0x55e687,_0x20d21d){return db[_0xac29('0x1d')]['update'](_0xaffccf[_0xac29('0x1e')],{'raw':_0xaffccf[_0xac29('0x1f')]?_0xaffccf['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xaffccf[_0xac29('0x1f')]?_0xaffccf[_0xac29('0x1f')][_0xac29('0x20')]||null:null,'attributes':_0xaffccf['options']?_0xaffccf[_0xac29('0x1f')][_0xac29('0x21')]||null:null,'limit':_0xaffccf[_0xac29('0x1f')]?_0xaffccf[_0xac29('0x1f')]['limit']||null:null})[_0xac29('0x22')](function(_0x131486){logger[_0xac29('0x13')](_0xac29('0x23'),_0xaffccf);logger[_0xac29('0x14')](_0xac29('0x23'),_0xaffccf,JSON['stringify'](_0x131486));_0x55e687(_0x131486);})[_0xac29('0x24')](function(_0x49bb4b){logger['error'](_0xac29('0x23'),_0x49bb4b[_0xac29('0x1b')],_0xaffccf);_0x20d21d(_0x541744[_0xac29('0x18')](0x1f4,_0x49bb4b[_0xac29('0x1b')]));});});};exports[_0xac29('0x25')]=function(_0x2be875){return new Promise(function(_0x2bcd86,_0x3063d3){return db['FaxInteraction'][_0xac29('0x26')]({'where':_0x2be875[_0xac29('0x1f')]?_0x2be875[_0xac29('0x1f')]['where']||null:null})[_0xac29('0x22')](function(_0x13e803){if(_0x13e803){return _0x13e803['addTags'](_0x2be875[_0xac29('0x1e')][_0xac29('0x27')],_['omit'](_0x2be875[_0xac29('0x1e')],[_0xac29('0x27'),'id'])||{});}})['spread'](function(_0x393714){logger[_0xac29('0x13')](_0xac29('0x28'),_0x2be875);logger[_0xac29('0x14')](_0xac29('0x28'),_0x2be875,JSON[_0xac29('0x17')](_0x393714));_0x2bcd86(_0x393714);})[_0xac29('0x24')](function(_0x4079d2){logger[_0xac29('0x18')](_0xac29('0x28'),_0x4079d2[_0xac29('0x1b')],_0x2be875);_0x3063d3(_this[_0xac29('0x18')](0x1f4,_0x4079d2['message']));});});};
\ No newline at end of file
+var _0x7b7d=['http','defaults','redis','socket.io-emitter','./faxInteraction.socket','register','then','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','FaxInteraction,\x20%s,\x20%s','info','catch','UpdateFaxInteraction','update','body','options','where','attributes','limit','AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x7b7d,0x10e));var _0xd7b7=function(_0x3a0674,_0x1c81fe){_0x3a0674=_0x3a0674-0x0;var _0x3437d7=_0x7b7d[_0x3a0674];return _0x3437d7;};'use strict';var _=require(_0xd7b7('0x0'));var util=require(_0xd7b7('0x1'));var moment=require(_0xd7b7('0x2'));var BPromise=require(_0xd7b7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd7b7('0x4'));var db=require(_0xd7b7('0x5'))['db'];var utils=require(_0xd7b7('0x6'));var logger=require('../../config/logger')(_0xd7b7('0x7'));var config=require('../../config/environment');var jayson=require(_0xd7b7('0x8'));var client=jayson[_0xd7b7('0x9')][_0xd7b7('0xa')]({'port':0x232a});config['redis']=_[_0xd7b7('0xb')](config[_0xd7b7('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd7b7('0xd'))(new Redis(config[_0xd7b7('0xc')]));require(_0xd7b7('0xe'))[_0xd7b7('0xf')](socket);function respondWithRpcPromise(_0x3582f6,_0x5f1566,_0x27ec44){return new BPromise(function(_0x4da846,_0x5c234c){return client['request'](_0x3582f6,_0x27ec44)[_0xd7b7('0x10')](function(_0x54ea0a){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x5f1566,_0xd7b7('0x11'));logger[_0xd7b7('0x12')](_0xd7b7('0x13'),_0x5f1566,_0xd7b7('0x11'),JSON['stringify'](_0x54ea0a));if(_0x54ea0a[_0xd7b7('0x14')]){if(_0x54ea0a[_0xd7b7('0x14')][_0xd7b7('0x15')]===0x1f4){logger[_0xd7b7('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x5f1566,_0x54ea0a[_0xd7b7('0x14')][_0xd7b7('0x16')]);return _0x5c234c(_0x54ea0a[_0xd7b7('0x14')][_0xd7b7('0x16')]);}logger[_0xd7b7('0x14')](_0xd7b7('0x17'),_0x5f1566,_0x54ea0a['error'][_0xd7b7('0x16')]);return _0x4da846(_0x54ea0a[_0xd7b7('0x14')][_0xd7b7('0x16')]);}else{logger[_0xd7b7('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x5f1566,'request\x20sent');_0x4da846(_0x54ea0a['result'][_0xd7b7('0x16')]);}})[_0xd7b7('0x19')](function(_0x3b52a9){logger[_0xd7b7('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x5f1566,_0x3b52a9);_0x5c234c(_0x3b52a9);});});}exports[_0xd7b7('0x1a')]=function(_0x37b78a){var _0x2edb13=this;return new Promise(function(_0x54781d,_0x35efee){return db['FaxInteraction'][_0xd7b7('0x1b')](_0x37b78a[_0xd7b7('0x1c')],{'raw':_0x37b78a[_0xd7b7('0x1d')]?_0x37b78a[_0xd7b7('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37b78a['options']?_0x37b78a[_0xd7b7('0x1d')][_0xd7b7('0x1e')]||null:null,'attributes':_0x37b78a[_0xd7b7('0x1d')]?_0x37b78a[_0xd7b7('0x1d')][_0xd7b7('0x1f')]||null:null,'limit':_0x37b78a['options']?_0x37b78a[_0xd7b7('0x1d')][_0xd7b7('0x20')]||null:null})[_0xd7b7('0x10')](function(_0x59025a){logger[_0xd7b7('0x18')](_0xd7b7('0x1a'),_0x37b78a);logger['debug']('UpdateFaxInteraction',_0x37b78a,JSON['stringify'](_0x59025a));_0x54781d(_0x59025a);})['catch'](function(_0x36995e){logger['error'](_0xd7b7('0x1a'),_0x36995e[_0xd7b7('0x16')],_0x37b78a);_0x35efee(_0x2edb13['error'](0x1f4,_0x36995e[_0xd7b7('0x16')]));});});};exports[_0xd7b7('0x21')]=function(_0x26d792){return new Promise(function(_0x3ca453,_0x53bd96){return db[_0xd7b7('0x22')][_0xd7b7('0x23')]({'where':_0x26d792['options']?_0x26d792[_0xd7b7('0x1d')][_0xd7b7('0x1e')]||null:null})[_0xd7b7('0x10')](function(_0x30e08c){if(_0x30e08c){return _0x30e08c[_0xd7b7('0x24')](_0x26d792['body'][_0xd7b7('0x25')],_['omit'](_0x26d792[_0xd7b7('0x1c')],['ids','id'])||{});}})[_0xd7b7('0x26')](function(_0x2ecdb0){logger[_0xd7b7('0x18')](_0xd7b7('0x27'),_0x26d792);logger[_0xd7b7('0x12')](_0xd7b7('0x27'),_0x26d792,JSON['stringify'](_0x2ecdb0));_0x3ca453(_0x2ecdb0);})[_0xd7b7('0x19')](function(_0x3bd4d3){logger[_0xd7b7('0x14')]('AddTags',_0x3bd4d3[_0xd7b7('0x16')],_0x26d792);_0x53bd96(_this[_0xd7b7('0x14')](0x1f4,_0x3bd4d3['message']));});});};
\ No newline at end of file