Built motion from commit 20b39a97.|2.6.29
[motion2.git] / server / api / openchannelInteraction / openchannelInteraction.rpc.js
index 871403c..2358155 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x543f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelInteraction','update','body','options','attributes','limit','UpdateOpenchannelInteraction','find','ids','AddTags','lodash'];(function(_0x3e55ff,_0x579048){var _0x30ca1a=function(_0xa2642c){while(--_0xa2642c){_0x3e55ff['push'](_0x3e55ff['shift']());}};_0x30ca1a(++_0x579048);}(_0x543f,0xf5));var _0xf543=function(_0x17a584,_0x327252){_0x17a584=_0x17a584-0x0;var _0x42a0c1=_0x543f[_0x17a584];return _0x42a0c1;};'use strict';var _=require(_0xf543('0x0'));var util=require('util');var moment=require(_0xf543('0x1'));var BPromise=require(_0xf543('0x2'));var rs=require(_0xf543('0x3'));var fs=require('fs');var Redis=require(_0xf543('0x4'));var db=require(_0xf543('0x5'))['db'];var utils=require(_0xf543('0x6'));var logger=require(_0xf543('0x7'))(_0xf543('0x8'));var config=require(_0xf543('0x9'));var jayson=require(_0xf543('0xa'));var client=jayson[_0xf543('0xb')][_0xf543('0xc')]({'port':0x232a});config[_0xf543('0xd')]=_[_0xf543('0xe')](config[_0xf543('0xd')],{'host':_0xf543('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf543('0x10'))[_0xf543('0x11')](socket);function respondWithRpcPromise(_0x46b135,_0x20530f,_0x321ed6){return new BPromise(function(_0xd844b2,_0x4e1585){return client[_0xf543('0x12')](_0x46b135,_0x321ed6)[_0xf543('0x13')](function(_0x120a8c){logger[_0xf543('0x14')](_0xf543('0x15'),_0x20530f,_0xf543('0x16'));logger[_0xf543('0x17')](_0xf543('0x18'),_0x20530f,'request\x20sent',JSON[_0xf543('0x19')](_0x120a8c));if(_0x120a8c[_0xf543('0x1a')]){if(_0x120a8c['error'][_0xf543('0x1b')]===0x1f4){logger[_0xf543('0x1a')]('OpenchannelInteraction,\x20%s,\x20%s',_0x20530f,_0x120a8c[_0xf543('0x1a')][_0xf543('0x1c')]);return _0x4e1585(_0x120a8c[_0xf543('0x1a')][_0xf543('0x1c')]);}logger[_0xf543('0x1a')]('OpenchannelInteraction,\x20%s,\x20%s',_0x20530f,_0x120a8c['error'][_0xf543('0x1c')]);return _0xd844b2(_0x120a8c[_0xf543('0x1a')][_0xf543('0x1c')]);}else{logger['info'](_0xf543('0x15'),_0x20530f,'request\x20sent');_0xd844b2(_0x120a8c[_0xf543('0x1d')][_0xf543('0x1c')]);}})[_0xf543('0x1e')](function(_0x50e072){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x20530f,_0x50e072);_0x4e1585(_0x50e072);});});}exports['UpdateOpenchannelInteraction']=function(_0x24c5b8){var _0x2bbccb=this;return new Promise(function(_0x5e77b8,_0x570f4e){return db[_0xf543('0x1f')][_0xf543('0x20')](_0x24c5b8[_0xf543('0x21')],{'raw':_0x24c5b8['options']?_0x24c5b8[_0xf543('0x22')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24c5b8[_0xf543('0x22')]?_0x24c5b8[_0xf543('0x22')]['where']||null:null,'attributes':_0x24c5b8[_0xf543('0x22')]?_0x24c5b8[_0xf543('0x22')][_0xf543('0x23')]||null:null,'limit':_0x24c5b8[_0xf543('0x22')]?_0x24c5b8[_0xf543('0x22')][_0xf543('0x24')]||null:null})[_0xf543('0x13')](function(_0x441d2b){logger[_0xf543('0x14')](_0xf543('0x25'),_0x24c5b8);logger[_0xf543('0x17')](_0xf543('0x25'),_0x24c5b8,JSON['stringify'](_0x441d2b));_0x5e77b8(_0x441d2b);})[_0xf543('0x1e')](function(_0x5c99e2){logger[_0xf543('0x1a')](_0xf543('0x25'),_0x5c99e2['message'],_0x24c5b8);_0x570f4e(_0x2bbccb[_0xf543('0x1a')](0x1f4,_0x5c99e2[_0xf543('0x1c')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x1080e0){return new Promise(function(_0x167ded,_0x5846c6){return db[_0xf543('0x1f')][_0xf543('0x26')]({'where':_0x1080e0[_0xf543('0x22')]?_0x1080e0[_0xf543('0x22')]['where']||null:null})[_0xf543('0x13')](function(_0x5cafd0){if(_0x5cafd0){return _0x5cafd0['addTags'](_0x1080e0[_0xf543('0x21')][_0xf543('0x27')],_['omit'](_0x1080e0['body'],[_0xf543('0x27'),'id'])||{});}})['spread'](function(_0x404171){logger['info'](_0xf543('0x28'),_0x1080e0);logger['debug'](_0xf543('0x28'),_0x1080e0,JSON[_0xf543('0x19')](_0x404171));_0x167ded(_0x404171);})['catch'](function(_0x1caa7c){logger[_0xf543('0x1a')](_0xf543('0x28'),_0x1caa7c[_0xf543('0x1c')],_0x1080e0);_0x5846c6(_this['error'](0x1f4,_0x1caa7c[_0xf543('0x1c')]));});});};
\ No newline at end of file
+var _0x0a4c=['OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','where','AddTagsToOpenchannelInteraction','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x0a4c,0x83));var _0xc0a4=function(_0xb0337,_0x3f942f){_0xb0337=_0xb0337-0x0;var _0x444c68=_0x0a4c[_0xb0337];return _0x444c68;};'use strict';var _=require(_0xc0a4('0x0'));var util=require(_0xc0a4('0x1'));var moment=require(_0xc0a4('0x2'));var BPromise=require(_0xc0a4('0x3'));var rs=require(_0xc0a4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc0a4('0x5'))['db'];var utils=require(_0xc0a4('0x6'));var logger=require(_0xc0a4('0x7'))('rpc');var config=require(_0xc0a4('0x8'));var jayson=require(_0xc0a4('0x9'));var client=jayson[_0xc0a4('0xa')]['http']({'port':0x232a});config['redis']=_[_0xc0a4('0xb')](config[_0xc0a4('0xc')],{'host':_0xc0a4('0xd'),'port':0x18eb});var socket=require(_0xc0a4('0xe'))(new Redis(config[_0xc0a4('0xc')]));require(_0xc0a4('0xf'))['register'](socket);function respondWithRpcPromise(_0x22b734,_0x537f33,_0x2d5bfb){return new BPromise(function(_0x55f516,_0x1f640d){return client[_0xc0a4('0x10')](_0x22b734,_0x2d5bfb)[_0xc0a4('0x11')](function(_0x443be4){logger[_0xc0a4('0x12')](_0xc0a4('0x13'),_0x537f33,'request\x20sent');logger[_0xc0a4('0x14')](_0xc0a4('0x15'),_0x537f33,_0xc0a4('0x16'),JSON[_0xc0a4('0x17')](_0x443be4));if(_0x443be4[_0xc0a4('0x18')]){if(_0x443be4['error']['code']===0x1f4){logger['error'](_0xc0a4('0x13'),_0x537f33,_0x443be4[_0xc0a4('0x18')][_0xc0a4('0x19')]);return _0x1f640d(_0x443be4[_0xc0a4('0x18')][_0xc0a4('0x19')]);}logger[_0xc0a4('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x537f33,_0x443be4[_0xc0a4('0x18')][_0xc0a4('0x19')]);return _0x55f516(_0x443be4['error'][_0xc0a4('0x19')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x537f33,_0xc0a4('0x16'));_0x55f516(_0x443be4[_0xc0a4('0x1a')][_0xc0a4('0x19')]);}})[_0xc0a4('0x1b')](function(_0x4cb9f1){logger[_0xc0a4('0x18')](_0xc0a4('0x13'),_0x537f33,_0x4cb9f1);_0x1f640d(_0x4cb9f1);});});}exports[_0xc0a4('0x1c')]=function(_0x3b65ad){var _0x1e33ab=this;return new Promise(function(_0x2b45de,_0x299fe9){return db[_0xc0a4('0x1d')]['update'](_0x3b65ad[_0xc0a4('0x1e')],{'raw':_0x3b65ad[_0xc0a4('0x1f')]?_0x3b65ad['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b65ad[_0xc0a4('0x1f')]?_0x3b65ad[_0xc0a4('0x1f')][_0xc0a4('0x20')]||null:null,'attributes':_0x3b65ad[_0xc0a4('0x1f')]?_0x3b65ad['options']['attributes']||null:null,'limit':_0x3b65ad[_0xc0a4('0x1f')]?_0x3b65ad[_0xc0a4('0x1f')]['limit']||null:null})[_0xc0a4('0x11')](function(_0x5bfe27){logger['info'](_0xc0a4('0x1c'),_0x3b65ad);logger[_0xc0a4('0x14')]('UpdateOpenchannelInteraction',_0x3b65ad,JSON[_0xc0a4('0x17')](_0x5bfe27));_0x2b45de(_0x5bfe27);})[_0xc0a4('0x1b')](function(_0x465e13){logger[_0xc0a4('0x18')](_0xc0a4('0x1c'),_0x465e13[_0xc0a4('0x19')],_0x3b65ad);_0x299fe9(_0x1e33ab[_0xc0a4('0x18')](0x1f4,_0x465e13[_0xc0a4('0x19')]));});});};exports[_0xc0a4('0x21')]=function(_0x5d7c3d){return new Promise(function(_0x5b4686,_0x1591f5){return db['OpenchannelInteraction']['find']({'where':_0x5d7c3d[_0xc0a4('0x1f')]?_0x5d7c3d[_0xc0a4('0x1f')][_0xc0a4('0x20')]||null:null})[_0xc0a4('0x11')](function(_0x2ab39b){if(_0x2ab39b){return _0x2ab39b[_0xc0a4('0x22')](_0x5d7c3d[_0xc0a4('0x1e')][_0xc0a4('0x23')],_[_0xc0a4('0x24')](_0x5d7c3d[_0xc0a4('0x1e')],[_0xc0a4('0x23'),'id'])||{});}})['spread'](function(_0x4a932f){logger[_0xc0a4('0x12')](_0xc0a4('0x25'),_0x5d7c3d);logger[_0xc0a4('0x14')](_0xc0a4('0x25'),_0x5d7c3d,JSON['stringify'](_0x4a932f));_0x5b4686(_0x4a932f);})[_0xc0a4('0x1b')](function(_0x376170){logger['error'](_0xc0a4('0x25'),_0x376170['message'],_0x5d7c3d);_0x1591f5(_this[_0xc0a4('0x18')](0x1f4,_0x376170[_0xc0a4('0x19')]));});});};
\ No newline at end of file