Built motion from commit 911eb874.|2.6.31
[motion2.git] / server / api / openchannelInteraction / openchannelInteraction.rpc.js
index 8d2a484..5bb072f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbff3=['options','where','attributes','limit','find','body','ids','omit','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xbff3,0x1c2));var _0x3bff=function(_0x4b6c11,_0x416406){_0x4b6c11=_0x4b6c11-0x0;var _0x58667d=_0xbff3[_0x4b6c11];return _0x58667d;};'use strict';var _=require(_0x3bff('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3bff('0x1'));var rs=require(_0x3bff('0x2'));var fs=require('fs');var Redis=require(_0x3bff('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3bff('0x4'));var logger=require(_0x3bff('0x5'))(_0x3bff('0x6'));var config=require(_0x3bff('0x7'));var jayson=require(_0x3bff('0x8'));var client=jayson[_0x3bff('0x9')][_0x3bff('0xa')]({'port':0x232a});config[_0x3bff('0xb')]=_['defaults'](config[_0x3bff('0xb')],{'host':_0x3bff('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3bff('0xb')]));require('./openchannelInteraction.socket')[_0x3bff('0xd')](socket);function respondWithRpcPromise(_0x285352,_0xe3ecbd,_0x324091){return new BPromise(function(_0x34c3bd,_0x4c46d2){return client[_0x3bff('0xe')](_0x285352,_0x324091)[_0x3bff('0xf')](function(_0x42f2c7){logger['info'](_0x3bff('0x10'),_0xe3ecbd,'request\x20sent');logger[_0x3bff('0x11')](_0x3bff('0x12'),_0xe3ecbd,_0x3bff('0x13'),JSON[_0x3bff('0x14')](_0x42f2c7));if(_0x42f2c7[_0x3bff('0x15')]){if(_0x42f2c7['error'][_0x3bff('0x16')]===0x1f4){logger[_0x3bff('0x15')](_0x3bff('0x10'),_0xe3ecbd,_0x42f2c7[_0x3bff('0x15')][_0x3bff('0x17')]);return _0x4c46d2(_0x42f2c7['error'][_0x3bff('0x17')]);}logger['error'](_0x3bff('0x10'),_0xe3ecbd,_0x42f2c7[_0x3bff('0x15')][_0x3bff('0x17')]);return _0x34c3bd(_0x42f2c7[_0x3bff('0x15')][_0x3bff('0x17')]);}else{logger[_0x3bff('0x18')](_0x3bff('0x10'),_0xe3ecbd,_0x3bff('0x13'));_0x34c3bd(_0x42f2c7[_0x3bff('0x19')][_0x3bff('0x17')]);}})[_0x3bff('0x1a')](function(_0xa146e){logger['error'](_0x3bff('0x10'),_0xe3ecbd,_0xa146e);_0x4c46d2(_0xa146e);});});}exports[_0x3bff('0x1b')]=function(_0x1c8e6d){var _0x23876b=this;return new Promise(function(_0x6fe512,_0x1d6713){return db[_0x3bff('0x1c')][_0x3bff('0x1d')](_0x1c8e6d['body'],{'raw':_0x1c8e6d[_0x3bff('0x1e')]?_0x1c8e6d[_0x3bff('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c8e6d[_0x3bff('0x1e')]?_0x1c8e6d[_0x3bff('0x1e')][_0x3bff('0x1f')]||null:null,'attributes':_0x1c8e6d[_0x3bff('0x1e')]?_0x1c8e6d[_0x3bff('0x1e')][_0x3bff('0x20')]||null:null,'limit':_0x1c8e6d[_0x3bff('0x1e')]?_0x1c8e6d['options'][_0x3bff('0x21')]||null:null})[_0x3bff('0xf')](function(_0x134e79){logger[_0x3bff('0x18')](_0x3bff('0x1b'),_0x1c8e6d);logger[_0x3bff('0x11')](_0x3bff('0x1b'),_0x1c8e6d,JSON[_0x3bff('0x14')](_0x134e79));_0x6fe512(_0x134e79);})['catch'](function(_0x2b6876){logger[_0x3bff('0x15')](_0x3bff('0x1b'),_0x2b6876[_0x3bff('0x17')],_0x1c8e6d);_0x1d6713(_0x23876b[_0x3bff('0x15')](0x1f4,_0x2b6876[_0x3bff('0x17')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x117c8f){return new Promise(function(_0x6e7bc,_0x52dd71){return db['OpenchannelInteraction'][_0x3bff('0x22')]({'where':_0x117c8f['options']?_0x117c8f[_0x3bff('0x1e')][_0x3bff('0x1f')]||null:null})[_0x3bff('0xf')](function(_0x20c880){if(_0x20c880){return _0x20c880['addTags'](_0x117c8f[_0x3bff('0x23')][_0x3bff('0x24')],_[_0x3bff('0x25')](_0x117c8f[_0x3bff('0x23')],['ids','id'])||{});}})[_0x3bff('0x26')](function(_0x545f1b){logger[_0x3bff('0x18')]('AddTags',_0x117c8f);logger['debug'](_0x3bff('0x27'),_0x117c8f,JSON[_0x3bff('0x14')](_0x545f1b));_0x6e7bc(_0x545f1b);})[_0x3bff('0x1a')](function(_0x1e4663){logger['error'](_0x3bff('0x27'),_0x1e4663[_0x3bff('0x17')],_0x117c8f);_0x52dd71(_this['error'](0x1f4,_0x1e4663[_0x3bff('0x17')]));});});};
\ No newline at end of file
+var _0xe8a0=['./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','OpenchannelInteraction','update','body','options','where','attributes','limit','UpdateOpenchannelInteraction','debug','stringify','catch','AddTagsToOpenchannelInteraction','find','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xe8a0,0x11e));var _0x0e8a=function(_0x2031eb,_0x1014a6){_0x2031eb=_0x2031eb-0x0;var _0x8e72c=_0xe8a0[_0x2031eb];return _0x8e72c;};'use strict';var _=require(_0x0e8a('0x0'));var util=require(_0x0e8a('0x1'));var moment=require(_0x0e8a('0x2'));var BPromise=require(_0x0e8a('0x3'));var rs=require(_0x0e8a('0x4'));var fs=require('fs');var Redis=require(_0x0e8a('0x5'));var db=require(_0x0e8a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e8a('0x7'))(_0x0e8a('0x8'));var config=require(_0x0e8a('0x9'));var jayson=require(_0x0e8a('0xa'));var client=jayson[_0x0e8a('0xb')][_0x0e8a('0xc')]({'port':0x232a});config[_0x0e8a('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0e8a('0xe'))(new Redis(config[_0x0e8a('0xd')]));require(_0x0e8a('0xf'))[_0x0e8a('0x10')](socket);function respondWithRpcPromise(_0x256041,_0x17177d,_0x1717fa){return new BPromise(function(_0x4a71a5,_0x399f23){return client[_0x0e8a('0x11')](_0x256041,_0x1717fa)[_0x0e8a('0x12')](function(_0x54f8a0){logger[_0x0e8a('0x13')](_0x0e8a('0x14'),_0x17177d,'request\x20sent');logger['debug'](_0x0e8a('0x15'),_0x17177d,_0x0e8a('0x16'),JSON['stringify'](_0x54f8a0));if(_0x54f8a0[_0x0e8a('0x17')]){if(_0x54f8a0[_0x0e8a('0x17')]['code']===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x17177d,_0x54f8a0['error']['message']);return _0x399f23(_0x54f8a0['error'][_0x0e8a('0x18')]);}logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x17177d,_0x54f8a0[_0x0e8a('0x17')]['message']);return _0x4a71a5(_0x54f8a0[_0x0e8a('0x17')]['message']);}else{logger[_0x0e8a('0x13')](_0x0e8a('0x14'),_0x17177d,_0x0e8a('0x16'));_0x4a71a5(_0x54f8a0[_0x0e8a('0x19')][_0x0e8a('0x18')]);}})['catch'](function(_0x53b7a5){logger[_0x0e8a('0x17')](_0x0e8a('0x14'),_0x17177d,_0x53b7a5);_0x399f23(_0x53b7a5);});});}exports['UpdateOpenchannelInteraction']=function(_0x10c037){var _0x548777=this;return new Promise(function(_0x5dcace,_0x4cff9e){return db[_0x0e8a('0x1a')][_0x0e8a('0x1b')](_0x10c037[_0x0e8a('0x1c')],{'raw':_0x10c037[_0x0e8a('0x1d')]?_0x10c037['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10c037[_0x0e8a('0x1d')]?_0x10c037[_0x0e8a('0x1d')][_0x0e8a('0x1e')]||null:null,'attributes':_0x10c037['options']?_0x10c037[_0x0e8a('0x1d')][_0x0e8a('0x1f')]||null:null,'limit':_0x10c037[_0x0e8a('0x1d')]?_0x10c037['options'][_0x0e8a('0x20')]||null:null})['then'](function(_0x57fdfc){logger['info'](_0x0e8a('0x21'),_0x10c037);logger[_0x0e8a('0x22')]('UpdateOpenchannelInteraction',_0x10c037,JSON[_0x0e8a('0x23')](_0x57fdfc));_0x5dcace(_0x57fdfc);})[_0x0e8a('0x24')](function(_0x364179){logger[_0x0e8a('0x17')](_0x0e8a('0x21'),_0x364179['message'],_0x10c037);_0x4cff9e(_0x548777[_0x0e8a('0x17')](0x1f4,_0x364179[_0x0e8a('0x18')]));});});};exports[_0x0e8a('0x25')]=function(_0x20487d){return new Promise(function(_0xe9fdad,_0x20dfcc){return db[_0x0e8a('0x1a')][_0x0e8a('0x26')]({'where':_0x20487d[_0x0e8a('0x1d')]?_0x20487d[_0x0e8a('0x1d')][_0x0e8a('0x1e')]||null:null})[_0x0e8a('0x12')](function(_0x26f12b){if(_0x26f12b){return _0x26f12b['addTags'](_0x20487d[_0x0e8a('0x1c')]['ids'],_[_0x0e8a('0x27')](_0x20487d[_0x0e8a('0x1c')],[_0x0e8a('0x28'),'id'])||{});}})[_0x0e8a('0x29')](function(_0x5f58d2){logger[_0x0e8a('0x13')](_0x0e8a('0x2a'),_0x20487d);logger[_0x0e8a('0x22')]('AddTags',_0x20487d,JSON[_0x0e8a('0x23')](_0x5f58d2));_0xe9fdad(_0x5f58d2);})['catch'](function(_0x2d9ab6){logger['error'](_0x0e8a('0x2a'),_0x2d9ab6[_0x0e8a('0x18')],_0x20487d);_0x20dfcc(_this[_0x0e8a('0x17')](0x1f4,_0x2d9ab6[_0x0e8a('0x18')]));});});};
\ No newline at end of file