Built motion from commit 709aa6fb5ed03aa61bc373fcdbf622215d37d30b. Version 3.0.0...
[motion-next.git] / server / api / cmContact / cmContact.rpc.js
index d5e296c..36b7870 100644 (file)
@@ -1 +1 @@
-const a129_0x4db7=['register','update','set','debug','options','length','../../mysqldb','info','table','cm_contacts','model','keys','CreateCmContact','GetCmContact','raw','../../rediscache','query','message','body','create','then','stringify','include','startsWith','catch','toString','map','error','CmContact','attributes','sequelize','rpc'];(function(_0x59123c,_0x4db7ff){const _0x17419d=function(_0x544467){while(--_0x544467){_0x59123c['push'](_0x59123c['shift']());}};_0x17419d(++_0x4db7ff);}(a129_0x4db7,0xbb));const a129_0x1741=function(_0x59123c,_0x4db7ff){_0x59123c=_0x59123c-0x0;let _0x17419d=a129_0x4db7[_0x59123c];return _0x17419d;};const _0x2538f7=a129_0x1741;'use strict';const _=require('lodash'),db=require(_0x2538f7('0xb'))['db'],logger=require('../../config/logger')(_0x2538f7('0x4')),squel=require('squel'),{getSocket}=require(_0x2538f7('0x14')),socket=getSocket();require('./cmContact.socket')[_0x2538f7('0x5')](socket),exports[_0x2538f7('0x12')]=function(_0x544467){const _0x419734=this;return new Promise(function(_0x5643ad,_0x430e93){const _0x5439eb=a129_0x1741;return db['CmContact']['findAll']({'raw':_0x544467[_0x5439eb('0x9')]?_0x544467[_0x5439eb('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x544467[_0x5439eb('0x9')]?_0x544467[_0x5439eb('0x9')]['where']||null:null,'attributes':_0x544467['options']?_0x544467['options'][_0x5439eb('0x2')]||null:null,'limit':_0x544467[_0x5439eb('0x9')]?_0x544467['options']['limit']||null:null,'include':_0x544467[_0x5439eb('0x9')]?_0x544467[_0x5439eb('0x9')][_0x5439eb('0x1b')]?_[_0x5439eb('0x1f')](_0x544467[_0x5439eb('0x9')][_0x5439eb('0x1b')],function(_0xd4f1d7){const _0x234079=_0x5439eb;return{'model':db[_0xd4f1d7[_0x234079('0xf')]],'as':_0xd4f1d7['as'],'attributes':_0xd4f1d7['attributes'],'include':_0xd4f1d7[_0x234079('0x1b')]?_['map'](_0xd4f1d7[_0x234079('0x1b')],function(_0x33f35c){const _0x4bfc2a=_0x234079;return{'model':db[_0x33f35c['model']],'as':_0x33f35c['as'],'attributes':_0x33f35c[_0x4bfc2a('0x2')],'include':_0x33f35c[_0x4bfc2a('0x1b')]?_[_0x4bfc2a('0x1f')](_0x33f35c[_0x4bfc2a('0x1b')],function(_0x3cdb01){const _0x58e9ab=_0x4bfc2a;return{'model':db[_0x3cdb01['model']],'as':_0x3cdb01['as'],'attributes':_0x3cdb01[_0x58e9ab('0x2')]};}):[]};}):[]};}):[]:[]})[_0x5439eb('0x19')](function(_0x35fa06){const _0x459344=_0x5439eb;logger['info'](_0x459344('0x12'),_0x544467),logger[_0x459344('0x8')](_0x459344('0x12'),_0x544467,JSON[_0x459344('0x1a')](_0x35fa06)),_0x5643ad(_0x35fa06);})[_0x5439eb('0x1d')](function(_0x509e3e){const _0x45fc43=_0x5439eb;logger['error'](_0x45fc43('0x12'),_0x509e3e[_0x45fc43('0x16')],_0x544467),_0x430e93(_0x419734[_0x45fc43('0x0')](0x1f4,_0x509e3e[_0x45fc43('0x16')]));});});},exports[_0x2538f7('0x11')]=function(_0x951d45){const _0x4b0bdf=this;return new Promise(function(_0x5080e3,_0x2fa6a3){const _0x2d51f2=a129_0x1741;return db[_0x2d51f2('0x1')][_0x2d51f2('0x18')](_0x951d45[_0x2d51f2('0x17')],{'raw':_0x951d45[_0x2d51f2('0x9')]?_0x951d45[_0x2d51f2('0x9')][_0x2d51f2('0x13')]===undefined?!![]:![]:!![]})[_0x2d51f2('0x19')](function(_0x4b31a1){const _0x32d4f8=_0x2d51f2;let _0x587243;for(let _0x41725e=0x0;_0x41725e<Object[_0x32d4f8('0x10')](_0x951d45[_0x32d4f8('0x17')])[_0x32d4f8('0xa')];_0x41725e++){const _0x143a38=Object['keys'](_0x951d45['body'])[_0x41725e];if(_0x143a38[_0x32d4f8('0x1c')]('cf_')){_0x587243=squel[_0x32d4f8('0x6')]()[_0x32d4f8('0xd')](_0x32d4f8('0xe'))[_0x32d4f8('0x7')](_0x143a38,_0x951d45[_0x32d4f8('0x17')][_0x143a38])['where']('id\x20=\x20?',_0x4b31a1['id'])[_0x32d4f8('0x1e')]();break;}}if(!_0x587243)return _0x4b31a1;return db[_0x32d4f8('0x3')][_0x32d4f8('0x15')](_0x587243)[_0x32d4f8('0x19')](function(){return _0x4b31a1;});})['then'](function(_0x481117){const _0x50984a=_0x2d51f2;logger[_0x50984a('0xc')](_0x50984a('0x11'),_0x951d45),logger[_0x50984a('0x8')](_0x50984a('0x11'),_0x951d45,JSON['stringify'](_0x481117)),_0x5080e3(_0x481117);})[_0x2d51f2('0x1d')](function(_0x1f5d86){const _0x2b6f42=_0x2d51f2;logger[_0x2b6f42('0x0')](_0x2b6f42('0x11'),_0x1f5d86[_0x2b6f42('0x16')],_0x951d45),_0x2fa6a3(_0x4b0bdf[_0x2b6f42('0x0')](0x1f4,_0x1f5d86[_0x2b6f42('0x16')]));});});};
\ No newline at end of file
+const a129_0x3a3e=['stringify','length','error','message','raw','include','squel','CreateCmContact','info','attributes','sequelize','limit','CmContact','../../config/logger','keys','startsWith','table','query','GetCmContact','model','lodash','map','../../mysqldb','where','debug','options','catch','toString','./cmContact.socket','cf_','body','then','create','update','id\x20=\x20?'];(function(_0x3b3ba4,_0x3a3ed7){const _0x54cf88=function(_0x2a5687){while(--_0x2a5687){_0x3b3ba4['push'](_0x3b3ba4['shift']());}};_0x54cf88(++_0x3a3ed7);}(a129_0x3a3e,0xff));const a129_0x54cf=function(_0x3b3ba4,_0x3a3ed7){_0x3b3ba4=_0x3b3ba4-0x0;let _0x54cf88=a129_0x3a3e[_0x3b3ba4];return _0x54cf88;};const _0x51ccff=a129_0x54cf;'use strict';const _=require(_0x51ccff('0xa')),db=require(_0x51ccff('0xc'))['db'],logger=require(_0x51ccff('0x3'))('rpc'),squel=require(_0x51ccff('0x1f')),{getSocket}=require('../../rediscache'),socket=getSocket();require(_0x51ccff('0x12'))['register'](socket),exports[_0x51ccff('0x8')]=function(_0x2a5687){const _0x44f08=this;return new Promise(function(_0x53dbe1,_0x5473ee){const _0x553edc=a129_0x54cf;return db[_0x553edc('0x2')]['findAll']({'raw':_0x2a5687[_0x553edc('0xf')]?_0x2a5687[_0x553edc('0xf')]['raw']===undefined?!![]:![]:!![],'where':_0x2a5687[_0x553edc('0xf')]?_0x2a5687[_0x553edc('0xf')][_0x553edc('0xd')]||null:null,'attributes':_0x2a5687[_0x553edc('0xf')]?_0x2a5687[_0x553edc('0xf')][_0x553edc('0x22')]||null:null,'limit':_0x2a5687[_0x553edc('0xf')]?_0x2a5687[_0x553edc('0xf')][_0x553edc('0x1')]||null:null,'include':_0x2a5687[_0x553edc('0xf')]?_0x2a5687[_0x553edc('0xf')]['include']?_[_0x553edc('0xb')](_0x2a5687[_0x553edc('0xf')][_0x553edc('0x1e')],function(_0x1ac9e1){const _0x10bcea=_0x553edc;return{'model':db[_0x1ac9e1[_0x10bcea('0x9')]],'as':_0x1ac9e1['as'],'attributes':_0x1ac9e1[_0x10bcea('0x22')],'include':_0x1ac9e1[_0x10bcea('0x1e')]?_['map'](_0x1ac9e1[_0x10bcea('0x1e')],function(_0x366d89){const _0x3fe5be=_0x10bcea;return{'model':db[_0x366d89['model']],'as':_0x366d89['as'],'attributes':_0x366d89[_0x3fe5be('0x22')],'include':_0x366d89[_0x3fe5be('0x1e')]?_[_0x3fe5be('0xb')](_0x366d89[_0x3fe5be('0x1e')],function(_0x33d04a){const _0x4356fb=_0x3fe5be;return{'model':db[_0x33d04a[_0x4356fb('0x9')]],'as':_0x33d04a['as'],'attributes':_0x33d04a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x17803b){const _0x5c086c=_0x553edc;logger['info']('GetCmContact',_0x2a5687),logger[_0x5c086c('0xe')]('GetCmContact',_0x2a5687,JSON[_0x5c086c('0x19')](_0x17803b)),_0x53dbe1(_0x17803b);})[_0x553edc('0x10')](function(_0x316115){const _0x4296d3=_0x553edc;logger[_0x4296d3('0x1b')](_0x4296d3('0x8'),_0x316115[_0x4296d3('0x1c')],_0x2a5687),_0x5473ee(_0x44f08[_0x4296d3('0x1b')](0x1f4,_0x316115[_0x4296d3('0x1c')]));});});},exports[_0x51ccff('0x20')]=function(_0x1023e7){const _0x268751=this;return new Promise(function(_0x4e51c8,_0x403add){const _0x141527=a129_0x54cf;return db[_0x141527('0x2')][_0x141527('0x16')](_0x1023e7[_0x141527('0x14')],{'raw':_0x1023e7['options']?_0x1023e7[_0x141527('0xf')][_0x141527('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x386429){const _0x5378d2=_0x141527;let _0x59e5bd;for(let _0x639739=0x0;_0x639739<Object[_0x5378d2('0x4')](_0x1023e7[_0x5378d2('0x14')])[_0x5378d2('0x1a')];_0x639739++){const _0x2dd91b=Object[_0x5378d2('0x4')](_0x1023e7['body'])[_0x639739];if(_0x2dd91b[_0x5378d2('0x5')](_0x5378d2('0x13'))){_0x59e5bd=squel[_0x5378d2('0x17')]()[_0x5378d2('0x6')]('cm_contacts')['set'](_0x2dd91b,_0x1023e7['body'][_0x2dd91b])[_0x5378d2('0xd')](_0x5378d2('0x18'),_0x386429['id'])[_0x5378d2('0x11')]();break;}}if(!_0x59e5bd)return _0x386429;return db[_0x5378d2('0x0')][_0x5378d2('0x7')](_0x59e5bd)[_0x5378d2('0x15')](function(){return _0x386429;});})['then'](function(_0x4e776b){const _0x572b7c=_0x141527;logger[_0x572b7c('0x21')]('CreateCmContact',_0x1023e7),logger[_0x572b7c('0xe')]('CreateCmContact',_0x1023e7,JSON['stringify'](_0x4e776b)),_0x4e51c8(_0x4e776b);})['catch'](function(_0x2f408a){const _0x3db548=_0x141527;logger['error'](_0x3db548('0x20'),_0x2f408a['message'],_0x1023e7),_0x403add(_0x268751[_0x3db548('0x1b')](0x1f4,_0x2f408a[_0x3db548('0x1c')]));});});};
\ No newline at end of file