Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / api / openchannelInteraction / openchannelInteraction.rpc.js
index 8fdb916..f46ca62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79ab=['AddTagsToOpenchannelInteraction','find','ids','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','OpenchannelInteraction','body','options','raw','where','attributes','limit','UpdateOpenchannelInteraction'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x79ab,0x133));var _0xb79a=function(_0x2ea08a,_0x240f73){_0x2ea08a=_0x2ea08a-0x0;var _0x5401ad=_0x79ab[_0x2ea08a];return _0x5401ad;};'use strict';var _=require(_0xb79a('0x0'));var util=require(_0xb79a('0x1'));var moment=require(_0xb79a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb79a('0x3'))['db'];var utils=require(_0xb79a('0x4'));var logger=require(_0xb79a('0x5'))('rpc');var config=require(_0xb79a('0x6'));var jayson=require(_0xb79a('0x7'));var client=jayson[_0xb79a('0x8')][_0xb79a('0x9')]({'port':0x232a});config[_0xb79a('0xa')]=_[_0xb79a('0xb')](config[_0xb79a('0xa')],{'host':_0xb79a('0xc'),'port':0x18eb});var socket=require(_0xb79a('0xd'))(new Redis(config['redis']));require(_0xb79a('0xe'))[_0xb79a('0xf')](socket);function respondWithRpcPromise(_0x2acf8f,_0x95b607,_0x482de2){return new BPromise(function(_0x4642dd,_0x651e36){return client[_0xb79a('0x10')](_0x2acf8f,_0x482de2)[_0xb79a('0x11')](function(_0x321fce){logger[_0xb79a('0x12')](_0xb79a('0x13'),_0x95b607,_0xb79a('0x14'));logger[_0xb79a('0x15')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x95b607,_0xb79a('0x14'),JSON[_0xb79a('0x16')](_0x321fce));if(_0x321fce[_0xb79a('0x17')]){if(_0x321fce[_0xb79a('0x17')]['code']===0x1f4){logger['error'](_0xb79a('0x13'),_0x95b607,_0x321fce[_0xb79a('0x17')]['message']);return _0x651e36(_0x321fce[_0xb79a('0x17')][_0xb79a('0x18')]);}logger[_0xb79a('0x17')](_0xb79a('0x13'),_0x95b607,_0x321fce[_0xb79a('0x17')]['message']);return _0x4642dd(_0x321fce[_0xb79a('0x17')]['message']);}else{logger[_0xb79a('0x12')](_0xb79a('0x13'),_0x95b607,_0xb79a('0x14'));_0x4642dd(_0x321fce[_0xb79a('0x19')][_0xb79a('0x18')]);}})[_0xb79a('0x1a')](function(_0x3a60b3){logger[_0xb79a('0x17')](_0xb79a('0x13'),_0x95b607,_0x3a60b3);_0x651e36(_0x3a60b3);});});}exports['UpdateOpenchannelInteraction']=function(_0x1afdc0){var _0x28a82e=this;return new Promise(function(_0x13f697,_0x142c66){return db[_0xb79a('0x1b')]['update'](_0x1afdc0[_0xb79a('0x1c')],{'raw':_0x1afdc0[_0xb79a('0x1d')]?_0x1afdc0[_0xb79a('0x1d')][_0xb79a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1afdc0[_0xb79a('0x1d')]?_0x1afdc0[_0xb79a('0x1d')][_0xb79a('0x1f')]||null:null,'attributes':_0x1afdc0[_0xb79a('0x1d')]?_0x1afdc0['options'][_0xb79a('0x20')]||null:null,'limit':_0x1afdc0[_0xb79a('0x1d')]?_0x1afdc0[_0xb79a('0x1d')][_0xb79a('0x21')]||null:null})[_0xb79a('0x11')](function(_0x3cf54d){logger[_0xb79a('0x12')](_0xb79a('0x22'),_0x1afdc0);logger[_0xb79a('0x15')](_0xb79a('0x22'),_0x1afdc0,JSON[_0xb79a('0x16')](_0x3cf54d));_0x13f697(_0x3cf54d);})[_0xb79a('0x1a')](function(_0x475914){logger[_0xb79a('0x17')](_0xb79a('0x22'),_0x475914[_0xb79a('0x18')],_0x1afdc0);_0x142c66(_0x28a82e[_0xb79a('0x17')](0x1f4,_0x475914[_0xb79a('0x18')]));});});};exports[_0xb79a('0x23')]=function(_0x22a91e){return new Promise(function(_0x93e84e,_0xb5ada2){return db[_0xb79a('0x1b')][_0xb79a('0x24')]({'where':_0x22a91e[_0xb79a('0x1d')]?_0x22a91e[_0xb79a('0x1d')][_0xb79a('0x1f')]||null:null})[_0xb79a('0x11')](function(_0xfea664){if(_0xfea664){return _0xfea664['addTags'](_0x22a91e[_0xb79a('0x1c')][_0xb79a('0x25')],_['omit'](_0x22a91e[_0xb79a('0x1c')],[_0xb79a('0x25'),'id'])||{});}})['spread'](function(_0x5e6934){logger['info']('AddTags',_0x22a91e);logger['debug']('AddTags',_0x22a91e,JSON['stringify'](_0x5e6934));_0x93e84e(_0x5e6934);})['catch'](function(_0x4b6736){logger['error']('AddTags',_0x4b6736[_0xb79a('0x18')],_0x22a91e);_0xb5ada2(_this[_0xb79a('0x17')](0x1f4,_0x4b6736[_0xb79a('0x18')]));});});};
\ No newline at end of file
+var _0xf145=['request','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','AddTagsToOpenchannelInteraction','then','ids','omit','spread','AddTags','stringify','lodash','util','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelInteraction.socket','register'];(function(_0x502773,_0xe55d92){var _0x568f34=function(_0x44a7f9){while(--_0x44a7f9){_0x502773['push'](_0x502773['shift']());}};_0x568f34(++_0xe55d92);}(_0xf145,0x8a));var _0x5f14=function(_0x331ce0,_0xe335b9){_0x331ce0=_0x331ce0-0x0;var _0x31c3c7=_0xf145[_0x331ce0];return _0x31c3c7;};'use strict';var _=require(_0x5f14('0x0'));var util=require(_0x5f14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5f14('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5f14('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5f14('0x4'));var config=require(_0x5f14('0x5'));var jayson=require(_0x5f14('0x6'));var client=jayson[_0x5f14('0x7')][_0x5f14('0x8')]({'port':0x232a});config[_0x5f14('0x9')]=_[_0x5f14('0xa')](config[_0x5f14('0x9')],{'host':_0x5f14('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5f14('0xc'))[_0x5f14('0xd')](socket);function respondWithRpcPromise(_0x1d9816,_0x247d46,_0x14de75){return new BPromise(function(_0x40ba49,_0x3e337b){return client[_0x5f14('0xe')](_0x1d9816,_0x14de75)['then'](function(_0x55f619){logger['info'](_0x5f14('0xf'),_0x247d46,_0x5f14('0x10'));logger[_0x5f14('0x11')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x247d46,_0x5f14('0x10'),JSON['stringify'](_0x55f619));if(_0x55f619[_0x5f14('0x12')]){if(_0x55f619['error'][_0x5f14('0x13')]===0x1f4){logger[_0x5f14('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x247d46,_0x55f619[_0x5f14('0x12')]['message']);return _0x3e337b(_0x55f619['error'][_0x5f14('0x14')]);}logger[_0x5f14('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x247d46,_0x55f619[_0x5f14('0x12')][_0x5f14('0x14')]);return _0x40ba49(_0x55f619[_0x5f14('0x12')]['message']);}else{logger[_0x5f14('0x15')](_0x5f14('0xf'),_0x247d46,_0x5f14('0x10'));_0x40ba49(_0x55f619[_0x5f14('0x16')][_0x5f14('0x14')]);}})['catch'](function(_0x5a476b){logger[_0x5f14('0x12')](_0x5f14('0xf'),_0x247d46,_0x5a476b);_0x3e337b(_0x5a476b);});});}exports[_0x5f14('0x17')]=function(_0x23b8ec){var _0x179bcc=this;return new Promise(function(_0x34b521,_0x1b839f){return db[_0x5f14('0x18')][_0x5f14('0x19')](_0x23b8ec[_0x5f14('0x1a')],{'raw':_0x23b8ec[_0x5f14('0x1b')]?_0x23b8ec[_0x5f14('0x1b')][_0x5f14('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23b8ec['options']?_0x23b8ec[_0x5f14('0x1b')][_0x5f14('0x1d')]||null:null,'attributes':_0x23b8ec[_0x5f14('0x1b')]?_0x23b8ec[_0x5f14('0x1b')][_0x5f14('0x1e')]||null:null,'limit':_0x23b8ec[_0x5f14('0x1b')]?_0x23b8ec['options']['limit']||null:null})['then'](function(_0xd32bd2){logger[_0x5f14('0x15')](_0x5f14('0x17'),_0x23b8ec);logger[_0x5f14('0x11')](_0x5f14('0x17'),_0x23b8ec,JSON['stringify'](_0xd32bd2));_0x34b521(_0xd32bd2);})['catch'](function(_0x114542){logger[_0x5f14('0x12')](_0x5f14('0x17'),_0x114542['message'],_0x23b8ec);_0x1b839f(_0x179bcc[_0x5f14('0x12')](0x1f4,_0x114542[_0x5f14('0x14')]));});});};exports[_0x5f14('0x1f')]=function(_0x46719){return new Promise(function(_0x484e0a,_0x592697){return db['OpenchannelInteraction']['find']({'where':_0x46719[_0x5f14('0x1b')]?_0x46719[_0x5f14('0x1b')]['where']||null:null})[_0x5f14('0x20')](function(_0x1757d7){if(_0x1757d7){return _0x1757d7['addTags'](_0x46719['body'][_0x5f14('0x21')],_[_0x5f14('0x22')](_0x46719[_0x5f14('0x1a')],[_0x5f14('0x21'),'id'])||{});}})[_0x5f14('0x23')](function(_0x207d8b){logger[_0x5f14('0x15')]('AddTags',_0x46719);logger[_0x5f14('0x11')](_0x5f14('0x24'),_0x46719,JSON[_0x5f14('0x25')](_0x207d8b));_0x484e0a(_0x207d8b);})['catch'](function(_0x1846ff){logger[_0x5f14('0x12')]('AddTags',_0x1846ff[_0x5f14('0x14')],_0x46719);_0x592697(_this['error'](0x1f4,_0x1846ff[_0x5f14('0x14')]));});});};
\ No newline at end of file