Built motion from commit 5ae82ce5.|2.6.7
[motion2.git] / server / api / openchannelInteraction / openchannelInteraction.rpc.js
index aad942c..782d876 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5100=['options','limit','catch','find','where','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','then','info','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body'];(function(_0x67ad7,_0x35567e){var _0x50dab2=function(_0x59c2e3){while(--_0x59c2e3){_0x67ad7['push'](_0x67ad7['shift']());}};_0x50dab2(++_0x35567e);}(_0x5100,0xac));var _0x0510=function(_0xf46a96,_0xc6539){_0xf46a96=_0xf46a96-0x0;var _0x464aad=_0x5100[_0xf46a96];return _0x464aad;};'use strict';var _=require(_0x0510('0x0'));var util=require(_0x0510('0x1'));var moment=require(_0x0510('0x2'));var BPromise=require(_0x0510('0x3'));var rs=require(_0x0510('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0510('0x5'))['db'];var utils=require(_0x0510('0x6'));var logger=require(_0x0510('0x7'))(_0x0510('0x8'));var config=require(_0x0510('0x9'));var jayson=require(_0x0510('0xa'));var client=jayson[_0x0510('0xb')][_0x0510('0xc')]({'port':0x232a});config[_0x0510('0xd')]=_[_0x0510('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0510('0xf'))(new Redis(config[_0x0510('0xd')]));require(_0x0510('0x10'))[_0x0510('0x11')](socket);function respondWithRpcPromise(_0x2eefcd,_0xee3553,_0xcc006a){return new BPromise(function(_0x2f09b2,_0x3c627c){return client['request'](_0x2eefcd,_0xcc006a)[_0x0510('0x12')](function(_0x370e2c){logger[_0x0510('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0xee3553,_0x0510('0x14'));logger[_0x0510('0x15')](_0x0510('0x16'),_0xee3553,_0x0510('0x14'),JSON[_0x0510('0x17')](_0x370e2c));if(_0x370e2c[_0x0510('0x18')]){if(_0x370e2c[_0x0510('0x18')][_0x0510('0x19')]===0x1f4){logger[_0x0510('0x18')](_0x0510('0x1a'),_0xee3553,_0x370e2c[_0x0510('0x18')][_0x0510('0x1b')]);return _0x3c627c(_0x370e2c[_0x0510('0x18')][_0x0510('0x1b')]);}logger[_0x0510('0x18')](_0x0510('0x1a'),_0xee3553,_0x370e2c[_0x0510('0x18')][_0x0510('0x1b')]);return _0x2f09b2(_0x370e2c[_0x0510('0x18')]['message']);}else{logger[_0x0510('0x13')](_0x0510('0x1a'),_0xee3553,_0x0510('0x14'));_0x2f09b2(_0x370e2c[_0x0510('0x1c')][_0x0510('0x1b')]);}})['catch'](function(_0x2ae922){logger[_0x0510('0x18')](_0x0510('0x1a'),_0xee3553,_0x2ae922);_0x3c627c(_0x2ae922);});});}exports[_0x0510('0x1d')]=function(_0x3db72f){var _0xfca31c=this;return new Promise(function(_0x21ef2a,_0x3e0861){return db[_0x0510('0x1e')][_0x0510('0x1f')](_0x3db72f[_0x0510('0x20')],{'raw':_0x3db72f[_0x0510('0x21')]?_0x3db72f[_0x0510('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3db72f[_0x0510('0x21')]?_0x3db72f[_0x0510('0x21')]['where']||null:null,'attributes':_0x3db72f[_0x0510('0x21')]?_0x3db72f[_0x0510('0x21')]['attributes']||null:null,'limit':_0x3db72f[_0x0510('0x21')]?_0x3db72f[_0x0510('0x21')][_0x0510('0x22')]||null:null})[_0x0510('0x12')](function(_0x5990b0){logger['info']('UpdateOpenchannelInteraction',_0x3db72f);logger[_0x0510('0x15')](_0x0510('0x1d'),_0x3db72f,JSON[_0x0510('0x17')](_0x5990b0));_0x21ef2a(_0x5990b0);})[_0x0510('0x23')](function(_0x3d2602){logger[_0x0510('0x18')](_0x0510('0x1d'),_0x3d2602['message'],_0x3db72f);_0x3e0861(_0xfca31c[_0x0510('0x18')](0x1f4,_0x3d2602['message']));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x473739){return new Promise(function(_0x3e3683,_0x5f16b4){return db['OpenchannelInteraction'][_0x0510('0x24')]({'where':_0x473739[_0x0510('0x21')]?_0x473739[_0x0510('0x21')][_0x0510('0x25')]||null:null})[_0x0510('0x12')](function(_0x3a39d3){if(_0x3a39d3){return _0x3a39d3['addTags'](_0x473739[_0x0510('0x20')][_0x0510('0x26')],_[_0x0510('0x27')](_0x473739[_0x0510('0x20')],[_0x0510('0x26'),'id'])||{});}})['spread'](function(_0x18c917){logger['info'](_0x0510('0x28'),_0x473739);logger[_0x0510('0x15')](_0x0510('0x28'),_0x473739,JSON[_0x0510('0x17')](_0x18c917));_0x3e3683(_0x18c917);})[_0x0510('0x23')](function(_0x4f16df){logger[_0x0510('0x18')](_0x0510('0x28'),_0x4f16df[_0x0510('0x1b')],_0x473739);_0x5f16b4(_this[_0x0510('0x18')](0x1f4,_0x4f16df[_0x0510('0x1b')]));});});};
\ No newline at end of file
+var _0x0f55=['request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','OpenchannelInteraction,\x20%s,\x20%s','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','raw','options','where','limit','then','AddTagsToOpenchannelInteraction','addTags','body','omit','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','request','info'];(function(_0x59a3dd,_0xad48e3){var _0x18aec7=function(_0xdfb2e1){while(--_0xdfb2e1){_0x59a3dd['push'](_0x59a3dd['shift']());}};_0x18aec7(++_0xad48e3);}(_0x0f55,0xbc));var _0x50f5=function(_0x4d7a61,_0x3fb6e6){_0x4d7a61=_0x4d7a61-0x0;var _0x186f73=_0x0f55[_0x4d7a61];return _0x186f73;};'use strict';var _=require(_0x50f5('0x0'));var util=require(_0x50f5('0x1'));var moment=require(_0x50f5('0x2'));var BPromise=require('bluebird');var rs=require(_0x50f5('0x3'));var fs=require('fs');var Redis=require(_0x50f5('0x4'));var db=require(_0x50f5('0x5'))['db'];var utils=require(_0x50f5('0x6'));var logger=require(_0x50f5('0x7'))('rpc');var config=require(_0x50f5('0x8'));var jayson=require(_0x50f5('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x50f5('0xa')]=_[_0x50f5('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x50f5('0xc'))(new Redis(config[_0x50f5('0xa')]));require(_0x50f5('0xd'))[_0x50f5('0xe')](socket);function respondWithRpcPromise(_0x28e5a2,_0xd2420e,_0x43a430){return new BPromise(function(_0x204be9,_0x529449){return client[_0x50f5('0xf')](_0x28e5a2,_0x43a430)['then'](function(_0x1ad0e2){logger[_0x50f5('0x10')]('OpenchannelInteraction,\x20%s,\x20%s',_0xd2420e,_0x50f5('0x11'));logger[_0x50f5('0x12')](_0x50f5('0x13'),_0xd2420e,_0x50f5('0x11'),JSON[_0x50f5('0x14')](_0x1ad0e2));if(_0x1ad0e2[_0x50f5('0x15')]){if(_0x1ad0e2[_0x50f5('0x15')]['code']===0x1f4){logger[_0x50f5('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0xd2420e,_0x1ad0e2[_0x50f5('0x15')]['message']);return _0x529449(_0x1ad0e2[_0x50f5('0x15')][_0x50f5('0x16')]);}logger[_0x50f5('0x15')](_0x50f5('0x17'),_0xd2420e,_0x1ad0e2['error'][_0x50f5('0x16')]);return _0x204be9(_0x1ad0e2['error'][_0x50f5('0x16')]);}else{logger[_0x50f5('0x10')]('OpenchannelInteraction,\x20%s,\x20%s',_0xd2420e,_0x50f5('0x11'));_0x204be9(_0x1ad0e2[_0x50f5('0x18')][_0x50f5('0x16')]);}})[_0x50f5('0x19')](function(_0x54bb41){logger[_0x50f5('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0xd2420e,_0x54bb41);_0x529449(_0x54bb41);});});}exports[_0x50f5('0x1a')]=function(_0x4abb65){var _0x40e865=this;return new Promise(function(_0x1afed5,_0x4aa29e){return db[_0x50f5('0x1b')][_0x50f5('0x1c')](_0x4abb65['body'],{'raw':_0x4abb65['options']?_0x4abb65['options'][_0x50f5('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4abb65[_0x50f5('0x1e')]?_0x4abb65[_0x50f5('0x1e')][_0x50f5('0x1f')]||null:null,'attributes':_0x4abb65[_0x50f5('0x1e')]?_0x4abb65[_0x50f5('0x1e')]['attributes']||null:null,'limit':_0x4abb65[_0x50f5('0x1e')]?_0x4abb65[_0x50f5('0x1e')][_0x50f5('0x20')]||null:null})[_0x50f5('0x21')](function(_0x525bd0){logger[_0x50f5('0x10')]('UpdateOpenchannelInteraction',_0x4abb65);logger[_0x50f5('0x12')](_0x50f5('0x1a'),_0x4abb65,JSON['stringify'](_0x525bd0));_0x1afed5(_0x525bd0);})[_0x50f5('0x19')](function(_0x56648a){logger[_0x50f5('0x15')](_0x50f5('0x1a'),_0x56648a[_0x50f5('0x16')],_0x4abb65);_0x4aa29e(_0x40e865['error'](0x1f4,_0x56648a['message']));});});};exports[_0x50f5('0x22')]=function(_0x2565b4){return new Promise(function(_0x73cea8,_0x5e4a17){return db[_0x50f5('0x1b')]['find']({'where':_0x2565b4[_0x50f5('0x1e')]?_0x2565b4[_0x50f5('0x1e')][_0x50f5('0x1f')]||null:null})['then'](function(_0x48e224){if(_0x48e224){return _0x48e224[_0x50f5('0x23')](_0x2565b4[_0x50f5('0x24')]['ids'],_[_0x50f5('0x25')](_0x2565b4[_0x50f5('0x24')],[_0x50f5('0x26'),'id'])||{});}})[_0x50f5('0x27')](function(_0x368980){logger['info']('AddTags',_0x2565b4);logger['debug'](_0x50f5('0x28'),_0x2565b4,JSON['stringify'](_0x368980));_0x73cea8(_0x368980);})[_0x50f5('0x19')](function(_0x5207a1){logger['error'](_0x50f5('0x28'),_0x5207a1[_0x50f5('0x16')],_0x2565b4);_0x5e4a17(_this['error'](0x1f4,_0x5207a1[_0x50f5('0x16')]));});});};
\ No newline at end of file