Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / api / chatInteraction / chatInteraction.rpc.js
index 1f46e42..902f564 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd8f=['addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatInteraction','update','body','options','raw','where','attributes','UpdateChatInteraction','debug','AddTagsToChatInteraction','find'];(function(_0x153846,_0x1227ad){var _0x3ee557=function(_0x514e76){while(--_0x514e76){_0x153846['push'](_0x153846['shift']());}};_0x3ee557(++_0x1227ad);}(_0xcd8f,0x199));var _0xfcd8=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xcd8f[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0xfcd8('0x0'));var util=require(_0xfcd8('0x1'));var moment=require(_0xfcd8('0x2'));var BPromise=require(_0xfcd8('0x3'));var rs=require(_0xfcd8('0x4'));var fs=require('fs');var Redis=require(_0xfcd8('0x5'));var db=require(_0xfcd8('0x6'))['db'];var utils=require(_0xfcd8('0x7'));var logger=require('../../config/logger')(_0xfcd8('0x8'));var config=require(_0xfcd8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfcd8('0xa')][_0xfcd8('0xb')]({'port':0x232a});config['redis']=_[_0xfcd8('0xc')](config['redis'],{'host':_0xfcd8('0xd'),'port':0x18eb});var socket=require(_0xfcd8('0xe'))(new Redis(config[_0xfcd8('0xf')]));require(_0xfcd8('0x10'))[_0xfcd8('0x11')](socket);function respondWithRpcPromise(_0x4a62cc,_0x18d83f,_0x275ecd){return new BPromise(function(_0x595f1e,_0x1b35f2){return client[_0xfcd8('0x12')](_0x4a62cc,_0x275ecd)[_0xfcd8('0x13')](function(_0x5210c8){logger[_0xfcd8('0x14')](_0xfcd8('0x15'),_0x18d83f,_0xfcd8('0x16'));logger['debug'](_0xfcd8('0x17'),_0x18d83f,_0xfcd8('0x16'),JSON[_0xfcd8('0x18')](_0x5210c8));if(_0x5210c8[_0xfcd8('0x19')]){if(_0x5210c8[_0xfcd8('0x19')][_0xfcd8('0x1a')]===0x1f4){logger[_0xfcd8('0x19')](_0xfcd8('0x15'),_0x18d83f,_0x5210c8[_0xfcd8('0x19')][_0xfcd8('0x1b')]);return _0x1b35f2(_0x5210c8[_0xfcd8('0x19')][_0xfcd8('0x1b')]);}logger[_0xfcd8('0x19')](_0xfcd8('0x15'),_0x18d83f,_0x5210c8[_0xfcd8('0x19')][_0xfcd8('0x1b')]);return _0x595f1e(_0x5210c8['error'][_0xfcd8('0x1b')]);}else{logger[_0xfcd8('0x14')](_0xfcd8('0x15'),_0x18d83f,_0xfcd8('0x16'));_0x595f1e(_0x5210c8[_0xfcd8('0x1c')]['message']);}})[_0xfcd8('0x1d')](function(_0x2a10f7){logger[_0xfcd8('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x18d83f,_0x2a10f7);_0x1b35f2(_0x2a10f7);});});}exports['UpdateChatInteraction']=function(_0x4786bc){var _0x340726=this;return new Promise(function(_0x5557e6,_0x230bee){return db[_0xfcd8('0x1e')][_0xfcd8('0x1f')](_0x4786bc[_0xfcd8('0x20')],{'raw':_0x4786bc[_0xfcd8('0x21')]?_0x4786bc['options'][_0xfcd8('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4786bc[_0xfcd8('0x21')]?_0x4786bc[_0xfcd8('0x21')][_0xfcd8('0x23')]||null:null,'attributes':_0x4786bc[_0xfcd8('0x21')]?_0x4786bc['options'][_0xfcd8('0x24')]||null:null,'limit':_0x4786bc[_0xfcd8('0x21')]?_0x4786bc[_0xfcd8('0x21')]['limit']||null:null})[_0xfcd8('0x13')](function(_0x4adad9){logger[_0xfcd8('0x14')](_0xfcd8('0x25'),_0x4786bc);logger[_0xfcd8('0x26')](_0xfcd8('0x25'),_0x4786bc,JSON['stringify'](_0x4adad9));_0x5557e6(_0x4adad9);})['catch'](function(_0x2ec744){logger[_0xfcd8('0x19')]('UpdateChatInteraction',_0x2ec744[_0xfcd8('0x1b')],_0x4786bc);_0x230bee(_0x340726[_0xfcd8('0x19')](0x1f4,_0x2ec744['message']));});});};exports[_0xfcd8('0x27')]=function(_0x98d98c){return new Promise(function(_0x26ac28,_0x3584ad){return db[_0xfcd8('0x1e')][_0xfcd8('0x28')]({'where':_0x98d98c['options']?_0x98d98c[_0xfcd8('0x21')]['where']||null:null})['then'](function(_0x2cd6f0){if(_0x2cd6f0){return _0x2cd6f0[_0xfcd8('0x29')](_0x98d98c[_0xfcd8('0x20')]['ids'],_['omit'](_0x98d98c['body'],[_0xfcd8('0x2a'),'id'])||{});}})[_0xfcd8('0x2b')](function(_0x36c7c3){logger[_0xfcd8('0x14')](_0xfcd8('0x2c'),_0x98d98c);logger[_0xfcd8('0x26')](_0xfcd8('0x2c'),_0x98d98c,JSON['stringify'](_0x36c7c3));_0x26ac28(_0x36c7c3);})['catch'](function(_0x57376a){logger[_0xfcd8('0x19')](_0xfcd8('0x2c'),_0x57376a[_0xfcd8('0x1b')],_0x98d98c);_0x3584ad(_this[_0xfcd8('0x19')](0x1f4,_0x57376a[_0xfcd8('0x1b')]));});});};
\ No newline at end of file
+var _0xa5ef=['rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','code','ChatInteraction,\x20%s,\x20%s','error','message','result','catch','ChatInteraction','update','body','options','raw','where','limit','UpdateChatInteraction','stringify','AddTagsToChatInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x4a1fdd,_0x48798c){var _0x4f7c69=function(_0xd0fa07){while(--_0xd0fa07){_0x4a1fdd['push'](_0x4a1fdd['shift']());}};_0x4f7c69(++_0x48798c);}(_0xa5ef,0x127));var _0xfa5e=function(_0x2ef8c1,_0x2f72f4){_0x2ef8c1=_0x2ef8c1-0x0;var _0x288305=_0xa5ef[_0x2ef8c1];return _0x288305;};'use strict';var _=require(_0xfa5e('0x0'));var util=require(_0xfa5e('0x1'));var moment=require(_0xfa5e('0x2'));var BPromise=require('bluebird');var rs=require(_0xfa5e('0x3'));var fs=require('fs');var Redis=require(_0xfa5e('0x4'));var db=require(_0xfa5e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfa5e('0x6'));var config=require(_0xfa5e('0x7'));var jayson=require(_0xfa5e('0x8'));var client=jayson[_0xfa5e('0x9')]['http']({'port':0x232a});config[_0xfa5e('0xa')]=_[_0xfa5e('0xb')](config['redis'],{'host':_0xfa5e('0xc'),'port':0x18eb});var socket=require(_0xfa5e('0xd'))(new Redis(config['redis']));require(_0xfa5e('0xe'))[_0xfa5e('0xf')](socket);function respondWithRpcPromise(_0x5bc279,_0x4eb129,_0x4a9e95){return new BPromise(function(_0x2b69b2,_0xcbf1eb){return client[_0xfa5e('0x10')](_0x5bc279,_0x4a9e95)[_0xfa5e('0x11')](function(_0x51f178){logger[_0xfa5e('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x4eb129,'request\x20sent');logger[_0xfa5e('0x13')](_0xfa5e('0x14'),_0x4eb129,_0xfa5e('0x15'),JSON['stringify'](_0x51f178));if(_0x51f178['error']){if(_0x51f178['error'][_0xfa5e('0x16')]===0x1f4){logger['error'](_0xfa5e('0x17'),_0x4eb129,_0x51f178[_0xfa5e('0x18')][_0xfa5e('0x19')]);return _0xcbf1eb(_0x51f178['error'][_0xfa5e('0x19')]);}logger[_0xfa5e('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x4eb129,_0x51f178[_0xfa5e('0x18')][_0xfa5e('0x19')]);return _0x2b69b2(_0x51f178[_0xfa5e('0x18')][_0xfa5e('0x19')]);}else{logger[_0xfa5e('0x12')](_0xfa5e('0x17'),_0x4eb129,'request\x20sent');_0x2b69b2(_0x51f178[_0xfa5e('0x1a')][_0xfa5e('0x19')]);}})[_0xfa5e('0x1b')](function(_0x3f078c){logger[_0xfa5e('0x18')](_0xfa5e('0x17'),_0x4eb129,_0x3f078c);_0xcbf1eb(_0x3f078c);});});}exports['UpdateChatInteraction']=function(_0x359217){var _0x18c0ab=this;return new Promise(function(_0xd04622,_0x32d7a8){return db[_0xfa5e('0x1c')][_0xfa5e('0x1d')](_0x359217[_0xfa5e('0x1e')],{'raw':_0x359217[_0xfa5e('0x1f')]?_0x359217[_0xfa5e('0x1f')][_0xfa5e('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x359217[_0xfa5e('0x1f')]?_0x359217[_0xfa5e('0x1f')][_0xfa5e('0x21')]||null:null,'attributes':_0x359217['options']?_0x359217[_0xfa5e('0x1f')]['attributes']||null:null,'limit':_0x359217['options']?_0x359217['options'][_0xfa5e('0x22')]||null:null})[_0xfa5e('0x11')](function(_0x2bc00a){logger['info'](_0xfa5e('0x23'),_0x359217);logger[_0xfa5e('0x13')](_0xfa5e('0x23'),_0x359217,JSON[_0xfa5e('0x24')](_0x2bc00a));_0xd04622(_0x2bc00a);})[_0xfa5e('0x1b')](function(_0x3687d9){logger[_0xfa5e('0x18')](_0xfa5e('0x23'),_0x3687d9[_0xfa5e('0x19')],_0x359217);_0x32d7a8(_0x18c0ab[_0xfa5e('0x18')](0x1f4,_0x3687d9['message']));});});};exports[_0xfa5e('0x25')]=function(_0x17dc97){return new Promise(function(_0x13126b,_0x583f3e){return db['ChatInteraction'][_0xfa5e('0x26')]({'where':_0x17dc97[_0xfa5e('0x1f')]?_0x17dc97[_0xfa5e('0x1f')][_0xfa5e('0x21')]||null:null})[_0xfa5e('0x11')](function(_0x2b8ca7){if(_0x2b8ca7){return _0x2b8ca7[_0xfa5e('0x27')](_0x17dc97[_0xfa5e('0x1e')][_0xfa5e('0x28')],_['omit'](_0x17dc97[_0xfa5e('0x1e')],['ids','id'])||{});}})[_0xfa5e('0x29')](function(_0x1cdb2a){logger[_0xfa5e('0x12')](_0xfa5e('0x2a'),_0x17dc97);logger[_0xfa5e('0x13')]('AddTags',_0x17dc97,JSON[_0xfa5e('0x24')](_0x1cdb2a));_0x13126b(_0x1cdb2a);})[_0xfa5e('0x1b')](function(_0x2babbd){logger['error'](_0xfa5e('0x2a'),_0x2babbd['message'],_0x17dc97);_0x583f3e(_this[_0xfa5e('0x18')](0x1f4,_0x2babbd[_0xfa5e('0x19')]));});});};
\ No newline at end of file