Built motion from commit b5996064.|2.6.21
[motion2.git] / server / api / openchannelInteraction / openchannelInteraction.rpc.js
index b2c57e9..c841484 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x087f=['debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','UpdateOpenchannelInteraction','body','options','raw','where','limit','OpenchannelInteraction','find','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','OpenchannelInteraction,\x20%s,\x20%s'];(function(_0xfbe574,_0x5a11da){var _0x34be2a=function(_0xcdc2e3){while(--_0xcdc2e3){_0xfbe574['push'](_0xfbe574['shift']());}};_0x34be2a(++_0x5a11da);}(_0x087f,0x17d));var _0xf087=function(_0x5569d7,_0x38712d){_0x5569d7=_0x5569d7-0x0;var _0x19a6e4=_0x087f[_0x5569d7];return _0x19a6e4;};'use strict';var _=require(_0xf087('0x0'));var util=require('util');var moment=require(_0xf087('0x1'));var BPromise=require(_0xf087('0x2'));var rs=require(_0xf087('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf087('0x4'))['db'];var utils=require(_0xf087('0x5'));var logger=require(_0xf087('0x6'))('rpc');var config=require(_0xf087('0x7'));var jayson=require(_0xf087('0x8'));var client=jayson[_0xf087('0x9')][_0xf087('0xa')]({'port':0x232a});config[_0xf087('0xb')]=_[_0xf087('0xc')](config[_0xf087('0xb')],{'host':_0xf087('0xd'),'port':0x18eb});var socket=require(_0xf087('0xe'))(new Redis(config[_0xf087('0xb')]));require(_0xf087('0xf'))[_0xf087('0x10')](socket);function respondWithRpcPromise(_0x26a0d9,_0x165959,_0x3d6a21){return new BPromise(function(_0x45db47,_0x738a40){return client['request'](_0x26a0d9,_0x3d6a21)[_0xf087('0x11')](function(_0x351321){logger['info'](_0xf087('0x12'),_0x165959,'request\x20sent');logger[_0xf087('0x13')](_0xf087('0x14'),_0x165959,_0xf087('0x15'),JSON[_0xf087('0x16')](_0x351321));if(_0x351321[_0xf087('0x17')]){if(_0x351321[_0xf087('0x17')][_0xf087('0x18')]===0x1f4){logger[_0xf087('0x17')](_0xf087('0x12'),_0x165959,_0x351321[_0xf087('0x17')][_0xf087('0x19')]);return _0x738a40(_0x351321['error'][_0xf087('0x19')]);}logger[_0xf087('0x17')](_0xf087('0x12'),_0x165959,_0x351321[_0xf087('0x17')][_0xf087('0x19')]);return _0x45db47(_0x351321[_0xf087('0x17')]['message']);}else{logger[_0xf087('0x1a')](_0xf087('0x12'),_0x165959,'request\x20sent');_0x45db47(_0x351321['result']['message']);}})[_0xf087('0x1b')](function(_0x4999e9){logger[_0xf087('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x165959,_0x4999e9);_0x738a40(_0x4999e9);});});}exports[_0xf087('0x1c')]=function(_0x47ec8e){var _0xe09c3d=this;return new Promise(function(_0x38f3c4,_0x529984){return db['OpenchannelInteraction']['update'](_0x47ec8e[_0xf087('0x1d')],{'raw':_0x47ec8e[_0xf087('0x1e')]?_0x47ec8e['options'][_0xf087('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47ec8e[_0xf087('0x1e')]?_0x47ec8e[_0xf087('0x1e')][_0xf087('0x20')]||null:null,'attributes':_0x47ec8e[_0xf087('0x1e')]?_0x47ec8e[_0xf087('0x1e')]['attributes']||null:null,'limit':_0x47ec8e[_0xf087('0x1e')]?_0x47ec8e['options'][_0xf087('0x21')]||null:null})[_0xf087('0x11')](function(_0x1cd821){logger[_0xf087('0x1a')](_0xf087('0x1c'),_0x47ec8e);logger['debug'](_0xf087('0x1c'),_0x47ec8e,JSON[_0xf087('0x16')](_0x1cd821));_0x38f3c4(_0x1cd821);})['catch'](function(_0x4181cd){logger[_0xf087('0x17')]('UpdateOpenchannelInteraction',_0x4181cd[_0xf087('0x19')],_0x47ec8e);_0x529984(_0xe09c3d[_0xf087('0x17')](0x1f4,_0x4181cd[_0xf087('0x19')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x297ff7){return new Promise(function(_0xcba40b,_0xb226f3){return db[_0xf087('0x22')][_0xf087('0x23')]({'where':_0x297ff7['options']?_0x297ff7[_0xf087('0x1e')][_0xf087('0x20')]||null:null})[_0xf087('0x11')](function(_0x504eb7){if(_0x504eb7){return _0x504eb7['addTags'](_0x297ff7[_0xf087('0x1d')][_0xf087('0x24')],_[_0xf087('0x25')](_0x297ff7[_0xf087('0x1d')],[_0xf087('0x24'),'id'])||{});}})[_0xf087('0x26')](function(_0x3b4c5a){logger[_0xf087('0x1a')]('AddTags',_0x297ff7);logger[_0xf087('0x13')](_0xf087('0x27'),_0x297ff7,JSON[_0xf087('0x16')](_0x3b4c5a));_0xcba40b(_0x3b4c5a);})[_0xf087('0x1b')](function(_0x3ab93b){logger[_0xf087('0x17')]('AddTags',_0x3ab93b[_0xf087('0x19')],_0x297ff7);_0xb226f3(_this[_0xf087('0x17')](0x1f4,_0x3ab93b['message']));});});};
\ No newline at end of file
+var _0xb71b=['socket.io-emitter','./openchannelInteraction.socket','then','info','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','attributes','limit','debug','stringify','AddTagsToOpenchannelInteraction','body','ids','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis'];(function(_0x4c779c,_0x5ce627){var _0x5988a8=function(_0x26f64b){while(--_0x26f64b){_0x4c779c['push'](_0x4c779c['shift']());}};_0x5988a8(++_0x5ce627);}(_0xb71b,0x1e3));var _0xbb71=function(_0x2c969d,_0x9ba36f){_0x2c969d=_0x2c969d-0x0;var _0x442132=_0xb71b[_0x2c969d];return _0x442132;};'use strict';var _=require(_0xbb71('0x0'));var util=require(_0xbb71('0x1'));var moment=require(_0xbb71('0x2'));var BPromise=require('bluebird');var rs=require(_0xbb71('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb71('0x4'))['db'];var utils=require(_0xbb71('0x5'));var logger=require(_0xbb71('0x6'))(_0xbb71('0x7'));var config=require(_0xbb71('0x8'));var jayson=require(_0xbb71('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xbb71('0xa')]=_['defaults'](config[_0xbb71('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xbb71('0xb'))(new Redis(config[_0xbb71('0xa')]));require(_0xbb71('0xc'))['register'](socket);function respondWithRpcPromise(_0x25263c,_0x56ce41,_0x4cfdc0){return new BPromise(function(_0xe14e7,_0x14379e){return client['request'](_0x25263c,_0x4cfdc0)[_0xbb71('0xd')](function(_0x1996cc){logger[_0xbb71('0xe')]('OpenchannelInteraction,\x20%s,\x20%s',_0x56ce41,_0xbb71('0xf'));logger['debug'](_0xbb71('0x10'),_0x56ce41,_0xbb71('0xf'),JSON['stringify'](_0x1996cc));if(_0x1996cc[_0xbb71('0x11')]){if(_0x1996cc['error'][_0xbb71('0x12')]===0x1f4){logger[_0xbb71('0x11')](_0xbb71('0x13'),_0x56ce41,_0x1996cc[_0xbb71('0x11')]['message']);return _0x14379e(_0x1996cc[_0xbb71('0x11')][_0xbb71('0x14')]);}logger[_0xbb71('0x11')](_0xbb71('0x13'),_0x56ce41,_0x1996cc[_0xbb71('0x11')][_0xbb71('0x14')]);return _0xe14e7(_0x1996cc[_0xbb71('0x11')]['message']);}else{logger['info'](_0xbb71('0x13'),_0x56ce41,_0xbb71('0xf'));_0xe14e7(_0x1996cc[_0xbb71('0x15')][_0xbb71('0x14')]);}})[_0xbb71('0x16')](function(_0x42a0bd){logger[_0xbb71('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x56ce41,_0x42a0bd);_0x14379e(_0x42a0bd);});});}exports[_0xbb71('0x17')]=function(_0x30d1c3){var _0x5a3467=this;return new Promise(function(_0x477b24,_0x5e4f49){return db[_0xbb71('0x18')][_0xbb71('0x19')](_0x30d1c3['body'],{'raw':_0x30d1c3['options']?_0x30d1c3[_0xbb71('0x1a')][_0xbb71('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30d1c3['options']?_0x30d1c3[_0xbb71('0x1a')][_0xbb71('0x1c')]||null:null,'attributes':_0x30d1c3['options']?_0x30d1c3['options'][_0xbb71('0x1d')]||null:null,'limit':_0x30d1c3['options']?_0x30d1c3[_0xbb71('0x1a')][_0xbb71('0x1e')]||null:null})[_0xbb71('0xd')](function(_0x399266){logger[_0xbb71('0xe')](_0xbb71('0x17'),_0x30d1c3);logger[_0xbb71('0x1f')](_0xbb71('0x17'),_0x30d1c3,JSON[_0xbb71('0x20')](_0x399266));_0x477b24(_0x399266);})[_0xbb71('0x16')](function(_0x2bbc95){logger['error'](_0xbb71('0x17'),_0x2bbc95[_0xbb71('0x14')],_0x30d1c3);_0x5e4f49(_0x5a3467[_0xbb71('0x11')](0x1f4,_0x2bbc95[_0xbb71('0x14')]));});});};exports[_0xbb71('0x21')]=function(_0x16fc74){return new Promise(function(_0x17c17e,_0x15dcd6){return db[_0xbb71('0x18')]['find']({'where':_0x16fc74[_0xbb71('0x1a')]?_0x16fc74[_0xbb71('0x1a')]['where']||null:null})['then'](function(_0x363a3e){if(_0x363a3e){return _0x363a3e['addTags'](_0x16fc74[_0xbb71('0x22')][_0xbb71('0x23')],_['omit'](_0x16fc74[_0xbb71('0x22')],[_0xbb71('0x23'),'id'])||{});}})[_0xbb71('0x24')](function(_0x54fb5a){logger[_0xbb71('0xe')](_0xbb71('0x25'),_0x16fc74);logger[_0xbb71('0x1f')]('AddTags',_0x16fc74,JSON[_0xbb71('0x20')](_0x54fb5a));_0x17c17e(_0x54fb5a);})[_0xbb71('0x16')](function(_0x1c8bad){logger[_0xbb71('0x11')]('AddTags',_0x1c8bad['message'],_0x16fc74);_0x15dcd6(_this[_0xbb71('0x11')](0x1f4,_0x1c8bad['message']));});});};
\ No newline at end of file