Built motion from commit 6a92c2cd.|2.6.29
[motion2.git] / server / api / openchannelInteraction / openchannelInteraction.rpc.js
index d4920ad..d4eb44a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x557f=['OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result','UpdateOpenchannelInteraction','update','options','OpenchannelInteraction','find','where','addTags','body','ids','omit','spread','AddTags','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','request\x20sent','debug'];(function(_0x1a0184,_0x3d4bcf){var _0x17a88a=function(_0x724b3a){while(--_0x724b3a){_0x1a0184['push'](_0x1a0184['shift']());}};_0x17a88a(++_0x3d4bcf);}(_0x557f,0x64));var _0xf557=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x557f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf557('0x0'));var util=require('util');var moment=require(_0xf557('0x1'));var BPromise=require(_0xf557('0x2'));var rs=require(_0xf557('0x3'));var fs=require('fs');var Redis=require(_0xf557('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf557('0x5'));var logger=require(_0xf557('0x6'))('rpc');var config=require(_0xf557('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf557('0x8')][_0xf557('0x9')]({'port':0x232a});config[_0xf557('0xa')]=_['defaults'](config[_0xf557('0xa')],{'host':_0xf557('0xb'),'port':0x18eb});var socket=require(_0xf557('0xc'))(new Redis(config['redis']));require(_0xf557('0xd'))[_0xf557('0xe')](socket);function respondWithRpcPromise(_0x159eb3,_0x36c131,_0x1d4294){return new BPromise(function(_0x10d0fd,_0x5ed68a){return client[_0xf557('0xf')](_0x159eb3,_0x1d4294)[_0xf557('0x10')](function(_0x4ddcd5){logger[_0xf557('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x36c131,_0xf557('0x12'));logger[_0xf557('0x13')](_0xf557('0x14'),_0x36c131,_0xf557('0x12'),JSON[_0xf557('0x15')](_0x4ddcd5));if(_0x4ddcd5[_0xf557('0x16')]){if(_0x4ddcd5['error'][_0xf557('0x17')]===0x1f4){logger[_0xf557('0x16')](_0xf557('0x18'),_0x36c131,_0x4ddcd5[_0xf557('0x16')]['message']);return _0x5ed68a(_0x4ddcd5[_0xf557('0x16')][_0xf557('0x19')]);}logger[_0xf557('0x16')](_0xf557('0x18'),_0x36c131,_0x4ddcd5['error'][_0xf557('0x19')]);return _0x10d0fd(_0x4ddcd5[_0xf557('0x16')][_0xf557('0x19')]);}else{logger['info'](_0xf557('0x18'),_0x36c131,'request\x20sent');_0x10d0fd(_0x4ddcd5[_0xf557('0x1a')][_0xf557('0x19')]);}})['catch'](function(_0x20e351){logger[_0xf557('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x36c131,_0x20e351);_0x5ed68a(_0x20e351);});});}exports[_0xf557('0x1b')]=function(_0x3a1ab7){var _0x134f07=this;return new Promise(function(_0x1397dd,_0x548805){return db['OpenchannelInteraction'][_0xf557('0x1c')](_0x3a1ab7['body'],{'raw':_0x3a1ab7[_0xf557('0x1d')]?_0x3a1ab7[_0xf557('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a1ab7[_0xf557('0x1d')]?_0x3a1ab7[_0xf557('0x1d')]['where']||null:null,'attributes':_0x3a1ab7[_0xf557('0x1d')]?_0x3a1ab7['options']['attributes']||null:null,'limit':_0x3a1ab7['options']?_0x3a1ab7[_0xf557('0x1d')]['limit']||null:null})['then'](function(_0x38f290){logger[_0xf557('0x11')](_0xf557('0x1b'),_0x3a1ab7);logger['debug']('UpdateOpenchannelInteraction',_0x3a1ab7,JSON[_0xf557('0x15')](_0x38f290));_0x1397dd(_0x38f290);})['catch'](function(_0x2a5fca){logger[_0xf557('0x16')](_0xf557('0x1b'),_0x2a5fca['message'],_0x3a1ab7);_0x548805(_0x134f07[_0xf557('0x16')](0x1f4,_0x2a5fca[_0xf557('0x19')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x305e63){return new Promise(function(_0x1b185a,_0x8d8db8){return db[_0xf557('0x1e')][_0xf557('0x1f')]({'where':_0x305e63[_0xf557('0x1d')]?_0x305e63[_0xf557('0x1d')][_0xf557('0x20')]||null:null})[_0xf557('0x10')](function(_0x418af7){if(_0x418af7){return _0x418af7[_0xf557('0x21')](_0x305e63[_0xf557('0x22')][_0xf557('0x23')],_[_0xf557('0x24')](_0x305e63[_0xf557('0x22')],[_0xf557('0x23'),'id'])||{});}})[_0xf557('0x25')](function(_0x340391){logger[_0xf557('0x11')](_0xf557('0x26'),_0x305e63);logger[_0xf557('0x13')](_0xf557('0x26'),_0x305e63,JSON[_0xf557('0x15')](_0x340391));_0x1b185a(_0x340391);})[_0xf557('0x27')](function(_0x21b0d4){logger[_0xf557('0x16')](_0xf557('0x26'),_0x21b0d4[_0xf557('0x19')],_0x305e63);_0x8d8db8(_this[_0xf557('0x16')](0x1f4,_0x21b0d4[_0xf557('0x19')]));});});};
\ No newline at end of file
+var _0x34c9=['defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','options','raw','where','limit','catch','AddTagsToOpenchannelInteraction','find','addTags','body','ids','AddTags','debug','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x1f0964,_0x5ae58b){var _0x2b106d=function(_0x1a966e){while(--_0x1a966e){_0x1f0964['push'](_0x1f0964['shift']());}};_0x2b106d(++_0x5ae58b);}(_0x34c9,0x1ca));var _0x934c=function(_0x2fb67b,_0x1ab284){_0x2fb67b=_0x2fb67b-0x0;var _0x17b752=_0x34c9[_0x2fb67b];return _0x17b752;};'use strict';var _=require(_0x934c('0x0'));var util=require('util');var moment=require(_0x934c('0x1'));var BPromise=require(_0x934c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x934c('0x3'));var logger=require(_0x934c('0x4'))(_0x934c('0x5'));var config=require(_0x934c('0x6'));var jayson=require(_0x934c('0x7'));var client=jayson[_0x934c('0x8')]['http']({'port':0x232a});config[_0x934c('0x9')]=_[_0x934c('0xa')](config['redis'],{'host':_0x934c('0xb'),'port':0x18eb});var socket=require(_0x934c('0xc'))(new Redis(config[_0x934c('0x9')]));require(_0x934c('0xd'))['register'](socket);function respondWithRpcPromise(_0x17b615,_0xbb2940,_0x27bb2e){return new BPromise(function(_0x207e63,_0x53779a){return client[_0x934c('0xe')](_0x17b615,_0x27bb2e)[_0x934c('0xf')](function(_0x29835b){logger[_0x934c('0x10')](_0x934c('0x11'),_0xbb2940,_0x934c('0x12'));logger['debug'](_0x934c('0x13'),_0xbb2940,'request\x20sent',JSON[_0x934c('0x14')](_0x29835b));if(_0x29835b['error']){if(_0x29835b[_0x934c('0x15')][_0x934c('0x16')]===0x1f4){logger['error'](_0x934c('0x11'),_0xbb2940,_0x29835b[_0x934c('0x15')][_0x934c('0x17')]);return _0x53779a(_0x29835b[_0x934c('0x15')][_0x934c('0x17')]);}logger[_0x934c('0x15')](_0x934c('0x11'),_0xbb2940,_0x29835b['error'][_0x934c('0x17')]);return _0x207e63(_0x29835b[_0x934c('0x15')][_0x934c('0x17')]);}else{logger['info'](_0x934c('0x11'),_0xbb2940,_0x934c('0x12'));_0x207e63(_0x29835b[_0x934c('0x18')]['message']);}})['catch'](function(_0x2e3b8e){logger[_0x934c('0x15')](_0x934c('0x11'),_0xbb2940,_0x2e3b8e);_0x53779a(_0x2e3b8e);});});}exports[_0x934c('0x19')]=function(_0x4226bf){var _0x21b868=this;return new Promise(function(_0x450efb,_0x476b19){return db[_0x934c('0x1a')]['update'](_0x4226bf['body'],{'raw':_0x4226bf[_0x934c('0x1b')]?_0x4226bf[_0x934c('0x1b')][_0x934c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4226bf['options']?_0x4226bf[_0x934c('0x1b')][_0x934c('0x1d')]||null:null,'attributes':_0x4226bf['options']?_0x4226bf[_0x934c('0x1b')]['attributes']||null:null,'limit':_0x4226bf['options']?_0x4226bf['options'][_0x934c('0x1e')]||null:null})[_0x934c('0xf')](function(_0x2d01c0){logger[_0x934c('0x10')]('UpdateOpenchannelInteraction',_0x4226bf);logger['debug'](_0x934c('0x19'),_0x4226bf,JSON[_0x934c('0x14')](_0x2d01c0));_0x450efb(_0x2d01c0);})[_0x934c('0x1f')](function(_0x240d47){logger[_0x934c('0x15')](_0x934c('0x19'),_0x240d47['message'],_0x4226bf);_0x476b19(_0x21b868[_0x934c('0x15')](0x1f4,_0x240d47[_0x934c('0x17')]));});});};exports[_0x934c('0x20')]=function(_0xa79ef7){return new Promise(function(_0x4977ad,_0x425e61){return db['OpenchannelInteraction'][_0x934c('0x21')]({'where':_0xa79ef7['options']?_0xa79ef7[_0x934c('0x1b')]['where']||null:null})['then'](function(_0x38f9){if(_0x38f9){return _0x38f9[_0x934c('0x22')](_0xa79ef7[_0x934c('0x23')][_0x934c('0x24')],_['omit'](_0xa79ef7[_0x934c('0x23')],[_0x934c('0x24'),'id'])||{});}})['spread'](function(_0x3e4cbb){logger['info'](_0x934c('0x25'),_0xa79ef7);logger[_0x934c('0x26')](_0x934c('0x25'),_0xa79ef7,JSON['stringify'](_0x3e4cbb));_0x4977ad(_0x3e4cbb);})[_0x934c('0x1f')](function(_0x418551){logger[_0x934c('0x15')](_0x934c('0x25'),_0x418551[_0x934c('0x17')],_0xa79ef7);_0x425e61(_this['error'](0x1f4,_0x418551[_0x934c('0x17')]));});});};
\ No newline at end of file