Built motion from commit (unavailable).|2.3.91
[motion2.git] / server / api / openchannelInteraction / openchannelInteraction.rpc.js
index 2b363fe..97a47ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d58=['client','http','redis','localhost','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','UpdateOpenchannelInteraction','update','body','raw','options','AddTagsToOpenchannelInteraction','find','where','ids','omit','AddTags','stringify','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x117128,_0x4af930){var _0x1b6054=function(_0x4f1eac){while(--_0x4f1eac){_0x117128['push'](_0x117128['shift']());}};_0x1b6054(++_0x4af930);}(_0x5d58,0x187));var _0x85d5=function(_0x4b3105,_0x43a408){_0x4b3105=_0x4b3105-0x0;var _0x233761=_0x5d58[_0x4b3105];return _0x233761;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85d5('0x0'));var db=require(_0x85d5('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x85d5('0x2'))(_0x85d5('0x3'));var config=require('../../config/environment');var jayson=require(_0x85d5('0x4'));var client=jayson[_0x85d5('0x5')][_0x85d5('0x6')]({'port':0x232a});config[_0x85d5('0x7')]=_['defaults'](config[_0x85d5('0x7')],{'host':_0x85d5('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85d5('0x7')]));require('./openchannelInteraction.socket')[_0x85d5('0x9')](socket);function respondWithRpcPromise(_0x2ce6b9,_0x258f0c,_0x488dcb){return new BPromise(function(_0x499b36,_0x4e147a){return client[_0x85d5('0xa')](_0x2ce6b9,_0x488dcb)[_0x85d5('0xb')](function(_0xde1063){logger[_0x85d5('0xc')](_0x85d5('0xd'),_0x258f0c,_0x85d5('0xe'));logger[_0x85d5('0xf')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x258f0c,'request\x20sent',JSON['stringify'](_0xde1063));if(_0xde1063[_0x85d5('0x10')]){if(_0xde1063[_0x85d5('0x10')][_0x85d5('0x11')]===0x1f4){logger[_0x85d5('0x10')](_0x85d5('0xd'),_0x258f0c,_0xde1063[_0x85d5('0x10')][_0x85d5('0x12')]);return _0x4e147a(_0xde1063['error'][_0x85d5('0x12')]);}logger[_0x85d5('0x10')](_0x85d5('0xd'),_0x258f0c,_0xde1063[_0x85d5('0x10')][_0x85d5('0x12')]);return _0x499b36(_0xde1063[_0x85d5('0x10')][_0x85d5('0x12')]);}else{logger[_0x85d5('0xc')](_0x85d5('0xd'),_0x258f0c,_0x85d5('0xe'));_0x499b36(_0xde1063[_0x85d5('0x13')][_0x85d5('0x12')]);}})[_0x85d5('0x14')](function(_0x3df634){logger[_0x85d5('0x10')](_0x85d5('0xd'),_0x258f0c,_0x3df634);_0x4e147a(_0x3df634);});});}exports[_0x85d5('0x15')]=function(_0x1d6134){var _0x53bd11=this;return new Promise(function(_0xc56ad1,_0x133fa9){return db['OpenchannelInteraction'][_0x85d5('0x16')](_0x1d6134[_0x85d5('0x17')],{'raw':_0x1d6134['options']?_0x1d6134['options'][_0x85d5('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d6134['options']?_0x1d6134[_0x85d5('0x19')]['where']||null:null,'attributes':_0x1d6134[_0x85d5('0x19')]?_0x1d6134[_0x85d5('0x19')]['attributes']||null:null,'limit':_0x1d6134['options']?_0x1d6134['options']['limit']||null:null})[_0x85d5('0xb')](function(_0x46c06e){logger[_0x85d5('0xc')](_0x85d5('0x15'),_0x1d6134);logger[_0x85d5('0xf')](_0x85d5('0x15'),_0x1d6134,JSON['stringify'](_0x46c06e));_0xc56ad1(_0x46c06e);})[_0x85d5('0x14')](function(_0x4f8c66){logger[_0x85d5('0x10')](_0x85d5('0x15'),_0x4f8c66[_0x85d5('0x12')],_0x1d6134);_0x133fa9(_0x53bd11['error'](0x1f4,_0x4f8c66[_0x85d5('0x12')]));});});};exports[_0x85d5('0x1a')]=function(_0x815808){return new Promise(function(_0x370c97,_0x4605c5){return db['OpenchannelInteraction'][_0x85d5('0x1b')]({'where':_0x815808[_0x85d5('0x19')]?_0x815808[_0x85d5('0x19')][_0x85d5('0x1c')]||null:null})[_0x85d5('0xb')](function(_0x572daf){if(_0x572daf){return _0x572daf['addTags'](_0x815808[_0x85d5('0x17')][_0x85d5('0x1d')],_[_0x85d5('0x1e')](_0x815808[_0x85d5('0x17')],[_0x85d5('0x1d'),'id'])||{});}})['spread'](function(_0x3553c0){logger[_0x85d5('0xc')]('AddTags',_0x815808);logger['debug'](_0x85d5('0x1f'),_0x815808,JSON[_0x85d5('0x20')](_0x3553c0));_0x370c97(_0x3553c0);})['catch'](function(_0x13e772){logger['error'](_0x85d5('0x1f'),_0x13e772[_0x85d5('0x12')],_0x815808);_0x4605c5(_this['error'](0x1f4,_0x13e772[_0x85d5('0x12')]));});});};
\ No newline at end of file
+var _0x2675=['body','AddTags','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','limit','find','where','ids','omit'];(function(_0x5e495a,_0x3c4896){var _0x149657=function(_0xc5e2dd){while(--_0xc5e2dd){_0x5e495a['push'](_0x5e495a['shift']());}};_0x149657(++_0x3c4896);}(_0x2675,0x75));var _0x5267=function(_0x579b90,_0x49559a){_0x579b90=_0x579b90-0x0;var _0x4455c8=_0x2675[_0x579b90];return _0x4455c8;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});config[_0x5267('0x9')]=_[_0x5267('0xa')](config['redis'],{'host':_0x5267('0xb'),'port':0x18eb});var socket=require(_0x5267('0xc'))(new Redis(config['redis']));require(_0x5267('0xd'))['register'](socket);function respondWithRpcPromise(_0x3ff4e9,_0x207d47,_0x26e22b){return new BPromise(function(_0x534c2b,_0x3e6964){return client['request'](_0x3ff4e9,_0x26e22b)[_0x5267('0xe')](function(_0x5bbf00){logger[_0x5267('0xf')](_0x5267('0x10'),_0x207d47,_0x5267('0x11'));logger[_0x5267('0x12')](_0x5267('0x13'),_0x207d47,_0x5267('0x11'),JSON[_0x5267('0x14')](_0x5bbf00));if(_0x5bbf00[_0x5267('0x15')]){if(_0x5bbf00[_0x5267('0x15')][_0x5267('0x16')]===0x1f4){logger[_0x5267('0x15')](_0x5267('0x10'),_0x207d47,_0x5bbf00[_0x5267('0x15')]['message']);return _0x3e6964(_0x5bbf00['error'][_0x5267('0x17')]);}logger[_0x5267('0x15')](_0x5267('0x10'),_0x207d47,_0x5bbf00[_0x5267('0x15')][_0x5267('0x17')]);return _0x534c2b(_0x5bbf00[_0x5267('0x15')][_0x5267('0x17')]);}else{logger[_0x5267('0xf')](_0x5267('0x10'),_0x207d47,_0x5267('0x11'));_0x534c2b(_0x5bbf00[_0x5267('0x18')][_0x5267('0x17')]);}})['catch'](function(_0x18f32e){logger[_0x5267('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x207d47,_0x18f32e);_0x3e6964(_0x18f32e);});});}exports[_0x5267('0x19')]=function(_0x56733e){var _0x1cf835=this;return new Promise(function(_0x1019e7,_0x39c0c3){return db[_0x5267('0x1a')][_0x5267('0x1b')](_0x56733e['body'],{'raw':_0x56733e[_0x5267('0x1c')]?_0x56733e['options'][_0x5267('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56733e[_0x5267('0x1c')]?_0x56733e[_0x5267('0x1c')]['where']||null:null,'attributes':_0x56733e['options']?_0x56733e['options']['attributes']||null:null,'limit':_0x56733e['options']?_0x56733e[_0x5267('0x1c')][_0x5267('0x1e')]||null:null})[_0x5267('0xe')](function(_0x279377){logger[_0x5267('0xf')](_0x5267('0x19'),_0x56733e);logger[_0x5267('0x12')](_0x5267('0x19'),_0x56733e,JSON[_0x5267('0x14')](_0x279377));_0x1019e7(_0x279377);})['catch'](function(_0x5cb64f){logger[_0x5267('0x15')](_0x5267('0x19'),_0x5cb64f['message'],_0x56733e);_0x39c0c3(_0x1cf835[_0x5267('0x15')](0x1f4,_0x5cb64f['message']));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x43e7e7){return new Promise(function(_0x273769,_0x1f33b7){return db[_0x5267('0x1a')][_0x5267('0x1f')]({'where':_0x43e7e7['options']?_0x43e7e7['options'][_0x5267('0x20')]||null:null})[_0x5267('0xe')](function(_0x24496d){if(_0x24496d){return _0x24496d['addTags'](_0x43e7e7['body'][_0x5267('0x21')],_[_0x5267('0x22')](_0x43e7e7[_0x5267('0x23')],['ids','id'])||{});}})['spread'](function(_0x2249a1){logger[_0x5267('0xf')](_0x5267('0x24'),_0x43e7e7);logger[_0x5267('0x12')]('AddTags',_0x43e7e7,JSON[_0x5267('0x14')](_0x2249a1));_0x273769(_0x2249a1);})[_0x5267('0x25')](function(_0x4344c5){logger[_0x5267('0x15')](_0x5267('0x24'),_0x4344c5[_0x5267('0x17')],_0x43e7e7);_0x1f33b7(_this[_0x5267('0x15')](0x1f4,_0x4344c5[_0x5267('0x17')]));});});};
\ No newline at end of file